sudo mount -t drvfs D: /mnt/d
Identify your disk
GET-CimInstance -query "SELECT * from Win32_DiskDrive"
or
wmic diskdrive list brief
Mount using bare option:
wsl --mount \\.\PHYSICALDRIVE1 --bare
Mount LUKS device like this:
sudo lsblk
sudo blkid /dev/sdd3
sudo cryptsetup luksOpen /dev/sdd3 my-device
sudo mkdir -p /somewhere
sudo mount /dev/mapper/my-device /somewhere
Under windows you may explorer like this:
\\wsl.localhost\Debian\somewhere
Mount partition:
wsl --mount \\.\PHYSICALDRIVE1 --partition 1 --type ext4 --name myDisk
Under wsl it will be mounted at:
ls /mnt/wsl/PHYSICALDRIVE1p1
# or if name specified
ls /mnt/wsl/myDisk
After use you can unmount:
wsl --unmount \\.\PHYSICALDRIVE1
If want to mount an VHD disk first make it an device (use your ):
Write-Output "\\.\PhysicalDrive$((Mount-VHD -Path <pathToVHD> -PassThru | Get-Disk).Number)"
VHD disks from wsl distros are saved at:
C:\Users[user]\AppData\Local\Packages[distro]\LocalState[distroPackageName]
wsl from microsoft store has option to mount VHD directly:
wsl --mount --vhd <pathToVHD>