How to mount Linux file system using WSL2 on Windows 10


Hello, my name is Martina, as always we share what is asked of us in precious comments for our audience and it won't be the first time, stay until the end of the article to always be updated on the latest trends that we have prepared for you. As we told you last week, we read all the comments and create white content for you, so if you haven't already done so, leave us your email and we'll keep you updated. Without wasting any more time, I hope you read all the relevant content and see you in the next latest trend of Clomatica.

Starting with build 20211, Windows Subsystem for Linux 2 (WSL2) includes a new feature that allows you to attach and mount physical drives to access Linux file systems (such as east4) which are not natively supported in Windows 10.

The new feature is meant to help you access Linux files using File Explorer on a dual-boot system running Windows 10 and a Linux distribution on a different drive.

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

Index of contents

Mount the Linux file system in Windows 10

To mount a Linux file system using WSL2, follow these steps:

  1. To open Start on Windows 10.

  2. To seek shell powerright click on the top result and select the file Run as administrator option.

  3. Enter the following command to list the available physical disks and press Access:

    wmic diskdrive list brief
  4. Confirm the drive path in the "Device ID" column.

  5. Enter the following command to mount the Linux file system and press Access:

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

    In the controller, be sure to replace DISKPATH to the path to the drive with the Linux distribution you want to mount. For instance, wsl --mount .PHYSICALDRIVE2. If you want to mount a specific partition, you will need to use the --partition option with the partition number. For instance, wsl --mount .PHYSICALDRIVE2 --partition 1.

After completing the steps, the drive with Linux files will be mounted and visible in Windows 10.

Mount any Linux file system on Windows 10

The above steps will only attempt to mount a physical drive as ext4. If you want to specify a different file system, you need to use a different command with Windows Subsystem for Linux 2.

To mount a specific Linux file system on Windows 10, follow these steps:

  1. To open Start.

  2. To seek shell powerright click on the top result and select the file Run as administrator option.

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

    wmic diskdrive list brief
  4. Confirm the drive path in the "Device ID" column.

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

    wsl --mount DISKPATH -t FILESYSTEM

    In the controller, be sure to replace DISKPATH Y ARCHIVE SYSTEM to the Linux drive path and file system you want to mount. For example, to mount a disk like fatuse these commands: wsl --mount DISKPATH -t vfat.

After completing the steps, the drive with your Linux files will be mounted and accessible via File Explorer.

Access the Linux file system in Windows 10

To access files from a Linux file system on Windows 10, follow these steps:

  1. To open File navigator.

  2. Click on Linux item in the left navigation pane.

  3. In the address bar, go to wsl$ and navigate to the assembly folder. For instance, wsl$DISTRO-NAMEMOUNT-POINT.

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

After completing the steps, you will be able to browse Linux files from a file system that is not natively supported by Windows 10. In addition to using File Explorer, after you mount the drive, you can access systems by files such as "ext4" from the WSL2 console using command lines.

Unmount the Linux file system in Windows 10

To unmount the Linux file system in Windows 10 follow these steps

  1. To open Start.

  2. To seek shell powerright click on the top result and select the file Run as administrator option.

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

    wsl --unmount DISKPATH

    In the controller, be sure to replace DISKPATH to the device ID of the drive you want to unmount.

After completing the steps, the drive with the Linux file system will be unmounted and disconnected from Windows 10.

The feature is available in Windows 10 build 20211 and is expected to arrive in future versions of the operating system. if you can't see the new featureit's because you're running the latest preview release available on the developer channel.

Leave a Reply

Your email address will not be published. Required fields are marked *

Go up Change privacy settings