Skip to content

WSL2#

Mount Ext4 Disks Into WSL2#

  • Open the PowerShell as Administrator
  • Run the command below to list all the disks.
1
GET-CimInstance -query "SELECT * from Win32_DiskDrive"
  • Then we can see the result as below.
DeviceID           Caption              Partitions Size          Model
--------           -------              ---------- ----          -----
\\.\PHYSICALDRIVE0 WDC WD40EFPX-68C6CN0 0          4000784417280 WDC WD40EFPX-68C6CN0
\\.\PHYSICALDRIVE3 KINGSTON SNV2S500G   1          500105249280  KINGSTON SNV2S500G
\\.\PHYSICALDRIVE1 WDC WD40EFPX-68C6CN0 0          4000784417280 WDC WD40EFPX-68C6CN0
\\.\PHYSICALDRIVE2 KINGSTON SNV2S500G   3          500105249280  KINGSTON SNV2S500G
  • Then use the DeviceID with the command below to mount the Disk into the WSL2
1
wsl --mount \\.\PHYSICALDRIVE0
  • The open the WSL and run the command below to check the Disk is mounted successfully or not.
1
lsblk
  • Then we should see the result.
1
2
3
4
5
6
7
8
9
NAME
    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda   8:0    0 388.4M  1 disk
sdb   8:16   0   186M  1 disk
sdc   8:32   0     8G  0 disk [SWAP]
sdd   8:48   0     1T  0 disk /mnt/wslg/distro
                              /
sde   8:64   0   3.6T  0 disk
sdf   8:80   0   3.6T  0 disk /mnt/wsl/PHYSICALDRIVE0