Reading USB Drive via Windows Subsystem for Linux

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
Post Reply
sonnik
Posts: 6
Joined: Mon Jun 30, 2025 2:29 pm
x 3

Reading USB Drive via Windows Subsystem for Linux

Post by sonnik »

I was able to figure out how to read the USB Storage via WSL (Windows Subsytem for Linux). I'm not sure if this has been shared or not before, but just in case it hasn't - here's the general flow.

1. In Windows, search for "Turn Windows Features on or Off". (This is for latest Windows 11; other versions may use different terminology or have the applet in another location).
2. Turn on Windows Subsystem For Linux
3. I use Fedora. This would probably work on Ubuntu with variations.
4. Once this is done, run the following commands in a Windows terminal as an ADMINISTRATOR (or command prompt)

Code: Select all

wsl --install FedoraLinux-42
wsl -d FedoraLinux-42
5. In the linux terminal...

Code: Select all

sudo dnf install xfsprogs xfsdump
lsblk
(Note the drives like sda, sdb, sdc. A new one will show up after step 10, and that will be the drive you'll want to use).

6. In Windows, Settings - search for "Optional Features" (System -> Optional Features)
7. Click View Features
8. Search for wmic and install - this will take a couple of minutes
9. In Windows, open another terminal as ADMINISTRATOR
10. Type...

Code: Select all

wmic diskdrive list brief
wsl --mount \\.\PHYSICALDRIVE2 --bare
(...note that PHYSICALDRIVE2 may be different, look for your model of USB storage for the HD Homerun once Windows acknowledges the connection. Note, you won't see this as a drive accessible by Windows).

11. In the Fedora/WSL terminal, create a mountpoint for the drive. This can be anywhere on your actual file system. It's just an empty directory placeholder. For me, I'm creating a temp directory on my "G" drive called hdhr.

Code: Select all

mkdir /mnt/g/hdhr
12. Mount the drive... In my case, the drive mounts as sdd, and the HDHR storage partition is sdd1 (remember, I have a G drive ... your location may be different than /mnt/g)

Code: Select all

sudo mount -t xfs /dev/sdd1 /mnt/g/hdhr
13. Then in windows cd into the directory...

Code: Select all

cd /mnt/g/hdhr
ls -l
(you should see a HDHomeRun directory)

Code: Select all

cd HDHomeRun
ls
(you should see your recorded shows).

sonnik
Posts: 6
Joined: Mon Jun 30, 2025 2:29 pm
x 3

Re: Reading USB Drive via Windows Subsystem for Linux

Post by sonnik »

To copy a show directory, for example, Gilligan's Island

Using windows, I've created a directory on my G: drive called "shows" and a directory called "gilligans" underneath that.

In WSL/Fedora, the command is ... (assuming you have changed directory into the HDHomeRun as shown above)

Code: Select all

cp -r -- "Gilligan's Island"/* /mnt/g/shows/gilligans/

jasonl
Silicondust
Posts: 17424
Joined: Sun Oct 28, 2007 9:23 pm
x 64

Re: Reading USB Drive via Windows Subsystem for Linux

Post by jasonl »

You can skip 11 and 12 and just do:

Code: Select all

wsl --mount \\.\PHYSICALDRIVE2 --partition 1 --type xfs
It will mount at /mnt/wsl on the Linux side and you can also access it via \\wsl$\<DistroName>\mnt\wsl in File Explorer on the Windows side.

Post Reply