Mount Linux Partition with WSL

From Luniwiki
Jump to: navigation, search

Prerequisites

You will need to be on Windows 11 Build 22000 or higher to access this feature.

List available drives

C:\>wmic diskdrive list brief
Caption                                  DeviceID            Model                                    Partitions  Size
SYNOLOGY iSCSI Storage SCSI Disk Device  \\.\PHYSICALDRIVE1  SYNOLOGY iSCSI Storage SCSI Disk Device  1           10995110138880
Innostor IS621C USB bridg USB Device     \\.\PHYSICALDRIVE2  Innostor IS621C USB bridg USB Device     1           6001172513280
SAMSUNG SSD PM851 M.2 2280 256GB         \\.\PHYSICALDRIVE0  SAMSUNG SSD PM851 M.2 2280 256GB         3           256052966400

Mount drive partition

C:\>wsl --mount \\.\PHYSICALDRIVE1 --partition 1
The disk \\.\PHYSICALDRIVE1 was successfully mounted under the name 'PHYSICALDRIVE1p1'. The mountpoint can be found under the path pointed to by the automount setting (default: /mnt/wsl).
To unmount and detach the disk, run 'wsl --unmount \\.\PHYSICALDRIVE1'.

References

Daniel Simao 08:38, 8 September 2021 (EDT)