Skip to content

Instantly share code, notes, and snippets.

@Ogaday
Last active September 17, 2024 21:11
Show Gist options
  • Save Ogaday/2154f7df1b83e0724b49a95abf318c43 to your computer and use it in GitHub Desktop.
Save Ogaday/2154f7df1b83e0724b49a95abf318c43 to your computer and use it in GitHub Desktop.
Mounting ext4 drives via WSL
# Admin windows powershell console
GET-CimInstance -query "SELECT * from Win32_DiskDrive"
wsl --mount \\.\PHYSICALDRIVE1 --bare
# WSL
lsblk -lf
sudo mkdir /media/My\ Passport
sudo mount /dev/sdd2 /media/My\ Passport

Then when complete:

# WSL
sudo umount /media/My\ Passport
# Admin powershell console
wsl --unmount \\.\PHYSICALDRIVE1

Mount a USB:

# WSL
sudo mkdir -p /mnt/f
sudo mount -t drvfs f: /mnt/f -o uid=$(id -u $USER),gid=$(id -g $USER),metadata

Copy files using rsync:

time rsync --progress -ah <source> <dest>

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment