Mounting an External ext4 Disk on Windows (WSL2)

Mounting an external ext4 disk through WSL2 on Windows, and mapping the mount point to a Windows drive letter, gives you native Linux read/write access plus access from Windows Explorer. Here is the complete workflow.

Preparation (after each time you connect the disk)

1. Find the external disk number

Open PowerShell as Administrator and run the following command to identify the disk number:

1
Get-CimInstance -Query "SELECT * from Win32_DiskDrive"

In the returned list, find the model of your portable disk (for example, Innostor Ext. HDD USB Device) and look at the number at the end of the corresponding DeviceID (for example, \\.\PHYSICALDRIVE2 means disk number 2).

2. Take the disk offline in Windows

In an Administrator PowerShell:

1
2
3
4
diskpart
select disk 2
offline disk
exit

Note: if the disk number is not 2, replace the number in select disk 2 with the actual number found in step 1.

3. Attach the raw disk to the WSL2 kernel

In an Administrator PowerShell:

1
wsl --mount \\.\PHYSICALDRIVE2 --bare

Mount the filesystem and configure permissions (Linux side)

4. Find the ext4 partition and mount it

Enter Linux with wsl, run lsblk -f to confirm the partition whose TYPE is ext4 (assume it is sdd3), then run:

1
2
3
4
5
6
7
8
# Create the mount point (only needed once)
sudo mkdir -p /mnt/ext4_usb

# Mount the ext4 partition
sudo mount /dev/sdd3 /mnt/ext4_usb

# Give Windows full read/write access
sudo chmod -R 777 /mnt/ext4_usb

Map to a Windows drive letter

5. Map drive Z: (must use a normal user)

Press Win + R, type powershell, and press Enter (do not run as Administrator), then run:

1
subst Z: \\wsl.localhost\Ubuntu\mnt\ext4_usb

After that, you can double-click Z: in This PC and read/write it directly.

Safely remove/eject the disk

1. Remove the drive letter (normal user terminal)

1
subst Z: /D

2. Unmount the mount point in Linux (run inside wsl)

1
sudo umount /mnt/ext4_usb

3. Detach the disk from WSL in Windows (Administrator PowerShell)

1
wsl --unmount \\.\PHYSICALDRIVE2

4. Make Windows recognize the disk again (Administrator PowerShell)

1
2
3
4
diskpart
select disk 2
online disk
exit
CC BY-NC-ND 4.0