Mount / Unmount

How to mount drive with Linux file system using WSL 2 on Windows 10

You can now mount drives with Linux file systems on Windows 10 using the Windows Subsystem for Linux 2, and here's how.

WSL mount and unmount command

On Windows 10, starting with build 20211, the Windows Subsystem for Linux 2 (WSL 2) includes a new feature that allows you to attach and mount physical drives to access file systems that are not natively supported by the operating system, such as ext4.

According to Microsoft, the new feature will come in handy to access Linux files using File Explorer on dual-boot systems running Windows 10 and Linux using different drives.

In this guide, you will learn the steps to mount and unmount drives using the Windows Subsystem for Linux 2.

Mount drive with Linux ext4 file system with WSL 2

To attach and mount drives using WSL 2, use these steps:

  1. Open Start.

  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.

  3. Type the following command to list the available physical disks on Windows 10 and press Enter:

    wmic diskdrive list brief
  4. Confirm the drive path under the “Device ID” column.

  5. Type the following command to mount a drive and press Enter:

    wsl --mount DISKPATH
    Mount Linux file system (source: Microsoft)
    Mount Linux file system (source: Microsoft)

    In the command, make sure to replace DISKPATH for the path of the Linux drive you want to mount. (See step No. 4.)

Once you complete the steps, the drive with Linux files will mount, and it’ll be visible from Windows 10.

Mount drive with Linux specific file system with WSL 2

Using the previous steps will attempt to mount the physical drive as ext4. If you want to specify another file system, you’ll need to use a different command

To attach and mount a specific Linux file system using WSL 2, use these steps:

  1. Open Start.

  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.

  3. Type the following command to list the available physical disks on Windows 10 and press Enter:

    wmic diskdrive list brief
  4. Confirm the drive path under the “Device ID” column.

  5. Type the following command to mount a drive and press Enter:

    wsl --mount DISKPATH -t FILESYSTEM
    Mount Linux file system (source: Microsoft)
    Mount Linux file system (source: Microsoft)

    In the command, make sure to replace DISKPATH and FILESYSTEM for the path of the Linux drive and file system you want to mount. For example, to mount a disk as fat, use these command: wsl --mount DISKPATH -t vfat.

Once you complete the steps, the drive with Linux files will mount, and it’ll be visible from Windows 10.

Access Linux file system on Windows 10

To access access files from Linux drive, use these steps:

  1. Open File Explorer.

  2. Click the Linux item from the left pane.

  3. In the address bar navigate to \wsl$ and then access the mount folder. For example, \\wsl$\\DISTRO-NAME\\MOUNT-POINT.

    Linux ext4 access (source: Microsoft)
    Linux ext4 access (source: Microsoft)

After you complete the steps, you’ll be able to browse the Linux files from a file system that is not natively supported on Windows 10 using File Explorer.

In addition to using File Explorer, once the drive is mounted, you can access file systems like ext4 from the Windows Subsystem for Linux 2 command line console.

Unmount drive with Linux file system with WSL 2

To unmount Linux drive on Windows 10, use these steps

  1. Open Start.

  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.

  3. Type the following command to unmount and detach the drive and press Enter:

    wsl --unmount DISKPATH

    In the command, make sure to replace DISKPATH for the Device ID of the drive you’re trying to unmount.

Once you complete the steps, the drive with the Linux file system will unmount and detach from Windows 10.

The feature is available starting with Windows 10 build 20211, and it’s expected to arrive in future release of the operating system. If you can’t see the new feature, it’s because you’re running the latest preview build available in the Dev Channel.