How to mount a Linux file system using WSL2 on Windows 10

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 the Linux file system (such as ext4) which is not supported. support on Windows 10.

This new feature is intended to help you access Linux files using File Explorer on a dual boot system running Windows 10 and a Linux distribution on another drive.

In this tutorial, you will learn the steps to mount and unmount a drive using Windows Subsystem for Linux 2.

Mount Linux file system on Windows 10

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

Step 1. Open Start on Windows 10.

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

Step 3. Type the following command to list available physical drives and press Enter :

wmic diskdrive list brief

Step 4. Confirm the drive path in the "Device ID" column .

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

wsl --mount DISKPATH

How to mount a Linux file system using WSL2 on Windows 10 Picture 1

In this command, be sure to replace DISKPATH with the path of the drive where the Linux distribution you want to mount. For example:

wsl --mount .PHYSICALDRIVE2

If you want to mount a specific partition, you will need to use the --partition option with the partition number. For example:

wsl --mount .PHYSICALDRIVE2 --partition 1

After you complete the steps, the drive containing the Linux files will mount and will show up on Windows 10.

Mount any Linux file system on Windows 10

The previous steps will just try to mount a physical drive as ext4. If you want to specify a different file system, you'll need to use a command other than Windows Subsystem for Linux 2.

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

Step 1. Open Start.

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

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

wmic diskdrive list brief

Step 4. Confirm the drive path in the "Device ID" column .

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

wsl --mount DISKPATH -t FILESYSTEM

In this command, be sure to replace DISKPATH and FILESYSTEM for the drive path and the Linux file system you want to mount. For example, to mount the drive as fat, use the following command:

wsl --mount DISKPATH -t vfat

After you complete the steps, the drive containing the Linux files will mount and you can access it using File Explorer.

Access the Linux file system on Windows 10

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

Step 1. Open File Explorer.

Step 2. Click the Linux entry from the left navigation pane.

Step 3. In the address bar, navigate to wsl $ and then access to mount directory. For example:

wsl$DISTRO-NAMEMOUNT-POINT

How to mount a Linux file system using WSL2 on Windows 10 Picture 2

Navigate to wsl $ and then access the mount directory

After completing the steps, you will be able to browse Linux files from the file system that is not natively supported on Windows 10. In addition to using File Explorer, once the drive is mounted, you will be able to access the systems. file like 'ext4' from the WSL2 console using the command lines.

Unmount Linux file system on Windows 10

To unmount Linux file system on Windows 10, follow these steps:

Step 1. Open Start.

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

Step 3. Type the following command to unmount and remove the drive, then press Enter :

wsl --unmount DISKPATH

In the command, make sure to replace DISKPATH with the Device ID of the drive you want to unmount .

After you complete the steps, the drive with the Linux file system will be unmounted and removed from Windows 10.

This feature is available starting with Windows 10 build 20211 and is expected to be available in future operating system releases. If you can't see the new feature, it's because you're running the latest preview available in Dev Channel.

4 ★ | 49 Vote

May be interested

  • Learn the file system and folders on Linux operating systemsLearn the file system and folders on Linux operating systems
    linux and unix file systems are organized in a hierarchy similar to the structure of a hierarchical tree. the highest level of the file system is the root directory, denoted by a slash '/' (root directory).
  • 8 main differences between Windows and Linux8 main differences between Windows and Linux
    is linux and windows the same? linux is different from windows? that is the question that many people wonder when they first come into contact with the linux operating system. in this article we will help you answer that question.
  • How to Open an Img File on PC or MacHow to Open an Img File on PC or Mac
    this wikihow teaches you how to open a disk image file (.img) on windows or macos. an .img file is exact image of a file system—you can either mount it as a drive or open it in an app like winzip. press . this opens the windows file e...
  • Add the option to Mount right-click menu in Windows 8Add the option to Mount right-click menu in Windows 8
    with versions from windows 8 and above, microsoft has assisted users in using iso and img file packages via the mount option integrated in the right-click menu without the need for virtual drive creation software. however, for some reason, this option may not appear on your computer. but don't worry, we'll show you how to add this feature in the article below. please take a look.
  • Use Journalctl to read the system log on LinuxUse Journalctl to read the system log on Linux
    most linux-based operating systems have switched to systemd, which comes with a different daemon log called journald. to interact with these logs, use the journalctl utility.
  • How to fix Couldn't Mount File, The disc image file is corrupted on Windows 10How to fix Couldn't Mount File, The disc image file is corrupted on Windows 10
    some users have reported that they cannot mount the iso and when trying to do this they get the error message - couldn't mount file, the disc image file is corrupted.
  • Format and mount USB in LinuxFormat and mount USB in Linux
    you have a usb and don't know how to format and mount it in linux. this article will guide you to do that.
  • Which file system should be used for removable storage devicesWhich file system should be used for removable storage devices
    in the tutorial article below, we will learn about some concepts related to file system - file system for use with portable storage devices. in essence, file systems are extremely important components in an operating system, assigned by the user account ...
  • How to update from WSL to WSL 2 in Windows 10How to update from WSL to WSL 2 in Windows 10
    wsl 2 (windows subsystem for linux 2) is a new version of the architecture in wsl that changes the way linux distributions interact with windows. this guide will show you how to update from windows subsystem for linux (wsl) to wsl 2 in windows 10.
  • The reason and how to edit sudoers file in LinuxThe reason and how to edit sudoers file in Linux
    in a linux or macos system, there is a file called 'sudoers' that controls the deepest levels of your system permissions. it allows or denies a user to gain superuser access and holds some special options for sudo.