Mounting and accessing physical disks from WSL2 using wsl –mount

Last update: 29/10/2025
Author Isaac
  • WSL 2 allows you to attach physical disks and VHD/VHDX and mount ext4 natively with wsl --mount.
  • For discs Windows Use DRVFS; for Linux (ext4) first identifies partitions with --bare, lsblk and blkid.
  • Manage space with wsl --manage or manual methods (diskpart + resize2fs) and repair with e2fsck.
  • Keep in mind the limitations: full disks, kernel-supported types, and lack of support USB in wsl --mount.

WSL guide --mount and access to physical disks in WSL2

If you work with Linux and Windows daily, being able to mount and read ext4 disks without leaving your Windows PC is a real boon. With WSL 2, this is possible thanks to the `wsl.exe --mount` command, which allows you to attach physical disks and also VHD/VHDX files directly to your installed Linux distributions.

In this practical and comprehensive guide, I'll explain step-by-step how to identify disks, mount specific partitions, choose the file system type , access data from Windows Explorer, and troubleshoot common errors. You'll also learn how to increase the size of the WSL 2 virtual disk and what limitations exist today.

What is wsl –mount and when to use it

With WSL 2, we can run a real Linux kernel on Windows and, thanks to this, mount disks and partitions with native Linux file systems like ext4 . The key command for this is `wsl.exe --mount`, which attaches a physical disk (or a VHD) to the lightweight WSL 2 virtual machine and mounts it within the distribution.

It's important to distinguish between scenarios: If the volume is formatted for Windows (for example, NTFS accessible from Windows ), you can expose it in WSL using drvfs without needing wsl –mount. However, when dealing with a Linux-formatted disk (ext4, etc.) that Windows doesn't recognize, wsl –mount comes into play.

There is one important limitation: `wsl --mount` does not currently support USB devices, flash drives, or SD card readers . If you connect a USB/SATA enclosure or a USB dock, the mounting process may fail. In such cases, Microsoft recommends reviewing the guide " Connecting USB devices with usbipd-win," although this is not the same as mounting them as a block for ext4.

To find out if your computer is compatible with mounting disks from WSL, you must be running Windows 11 or using the version of WSL installed from the Microsoft Store . Check your version with:

wsl.exe --version

wsl interface --mount and file types

Requirements, installation and initial checks

First, make sure you meet the requirements: Windows 10 (not S edition) or Windows 11 , virtualization enabled in the BIOS/UEFI, and installation of the Windows Subsystem for Linux and Virtual Machine Platform features. On modern computers, everything is usually already set up, but it's a good idea to double-check.

Virtualization can be checked from the Task Manager (Performance tab): if it says Virtualization: Enabled , perfect. If not, enable it in BIOS/UEFI and, if necessary, you can force it to start with:

bcdedit /set hypervisorlaunchtype auto

To install WSL automatically, open PowerShell or CMD as administrator and run a single command :

wsl --install

This command enables the necessary components and installs Ubuntu by default, although you can choose another distro with wsl –install -d Debian or another from the list it displays:

wsl --list --online

Once installed, you can switch between WSL 1 and WSL 2, although you need WSL 2 to mount disks . Check the active versions with:

wsl --list --verbose

If you want a modern terminal experience , Windows Terminal (preferably the Preview version) works great with WSL. You can set your home folder to ~ , install a font with icons (e.g., Nerd Fonts), and customize profiles for each distribution.

  How to enlarge the cursor and change the mouse pointer in Dwelling home windows 10

Access Windows drives from WSL (drvfs)

When the volume is already mounted in Windows (for example, an NTFS drive D:), you don't need `wsl --mount` . You can expose it within Linux using drvfs by creating a directory and mounting it like this:

sudo mkdir -p /mnt/d
sudo mount -t drvfs D: /mnt/d

After that, you'll have D: available under /mnt/d and you can work with your files from Linux. If you need to convert paths between Windows and Linux, wslpath will solve that problem.

# Windows a Linux
wslpath "C:\\Users\\tu_usuario\\Documents"

# Linux a Windows
wslpath -w "/home/tu_usuario/proyecto"

You can also browse WSL file systems from Windows using Explorer: go to \\wsl$\Distro\home\user to enter your distro and use it as if it were a network folder.

Mount Linux disks (ext4) with wsl –mount

For Linux-formatted disks that are not readable by Windows (such as ext4, the standard in many distributions ), `wsl --mount` allows you to attach them to WSL 2, list their partitions, and mount them. Below are the two most common scenarios.

Mounting ext4 disks in WSL2

Scenario A: Unpartitioned disk

First, identify the disk using PowerShell. You can use CIM or WMIC; both list the PHYSICALDRIVEs present in the system.

# PowerShell (recomendado)
Get-CimInstance -Query "SELECT * from Win32_DiskDrive"

# WMIC (obsoleto, pero aún útil en muchos equipos)
wmic diskdrive list brief

Look at the DeviceID column, formatted as \\.\PHYSICALDRIVEX . Once located:

wsl.exe --mount \\.\PHYSICALDRIVEX

If there is no partition table , WSL will attempt to mount it directly as ext4 (default behavior). If it is not ext4, you can specify the type with `--type`.

wsl.exe --mount \\.\PHYSICALDRIVEX --type vfat

Scenario B: Partitioned disk

When you don't know what's inside, it's best to attach the disk without mounting it using the –bare option and list the partitions from Linux:

# En PowerShell
wsl.exe --mount \\.\PHYSICALDRIVEX --bare

Now, within WSL 2, list the block devices and their partitions with:

lsblk

You'll see something like: /dev/sdb, /dev/sdb1, /dev/sdb2… . To identify the file system of each partition, use:

sudo blkid /dev/sdb1

Once you have a clear index and type, mount the partition from Windows specifying both parameters:

wsl.exe --mount \\.\PHYSICALDRIVEX --partition 3 --type ext4

By default, the mount point is created under the automount.root configuration value , which is /mnt/wsl. This means your disk will appear in a folder within that directory, and from Windows you can navigate to \\wsl$\YourDistro\mnt\wsl\Name to access the data.

Options, mount name, partition and unmount styles

WSL 2 attempts to mount the entire disk as ext4 if you don't specify otherwise, but you can refine the mounting with these options: `--type <Type>`, `--partition <Index>`, `--options <MountOptions> `. Example of an ext4 option:

wsl.exe --mount \\.\PHYSICALDRIVEX --options "data=ordered"

If the disk scheme doesn't match the automatic mount, `--bare` leaves the block device within WSL so you can mount it manually from Linux (using `mount`, `fsck`, etc.). You can also customize the mount point name with `--name`.

wsl.exe --mount \\.\PHYSICALDRIVEX --name mis_datos

To unmount and disassociate a disk from WSL 2:

wsl.exe --unmount \\.\PHYSICALDRIVEX
# Si omites la ruta, desmonta todos los discos adjuntos
wsl.exe --unmount

Current limitations to take into account

  • Only full discs can be attached (not loose partitions). It is not possible to read the Windows boot disk partition with wsl –mount.
  • Only file systems natively supported by the kernelUser-space controllers such as ntfs-3g are not used with wsl --mount.
  • Systems not supported by the kernel can be mounted after –bare with FUSE from Linux.
  • There is no support for USB, pendrives or SD via wsl –mount. Check usbipd-win to redirect USB, knowing that it is not the same flow.
  How can I get Internet Explorer 11 on Windows 10?

Mounting VHD/VHDX virtual disks with WSL

In addition to physical disks, you can mount virtual hard disk files (VHD/VHDX). First, attach the VHD in Windows with administrator privileges and obtain its disk number:

Write-Output "\\.\PhysicalDrive$((Mount-VHD -Path <pathToVHD> -PassThru | Get-Disk).Number)"

With that path, proceed as with a physical disk, following the previous sections. You can also use `-vhd` when directly mounting the .vhdx file:

wsl.exe --mount <path-to.vhdx> --vhd

Each WSL 2 distribution stores its rootfs in an ext4.vhdx file . It's usually located in %LocalAppData%\Packages\LocalState. To manipulate this file (for example, to mount it manually), be sure to stop WSL with `wsl --shutdown` before making any changes.

VHD in WSL and space expansion

Disk space in WSL 2 and how to increase it

WSL 2 uses dynamic VHDs for each distribution, formatted in ext4 . These expand as needed up to a default maximum of 1 TB in the most recent versions (previously 512 GB or 256 GB). To check available space, you can run:

wsl.exe --system -d <nombre-distro> df -h /mnt/wslg/distro
# Si no te funciona, actualiza WSL desde Store o usa: wsl df -h /

The output details the total size, used size, available size, and percentage . If you run out of space, you can expand the VHD with `wsl --manage` (WSL 2.5 or later) or do it manually with `diskpart` and `resize2fs`.

Expand with wsl –manage (recommended)

First, turn off WSL :

wsl.exe --shutdown

Then resize by passing a valid memory string (only integers with B, MB, GB or TB):

wsl --manage <nombre-distro> --resize 512GB

If everything goes well, you will see messages from e2fsck and resize2fs indicating that the operation was completed.

Step-by-step manual enlargement

If you prefer the classic method, here's a simplified flow that works very well when you don't have wsl –manage :

  1. Turn off WSL: wsl.exe –shutdown
  2. Locate the ext4.vhdx file of your distro (below you have a script to find it).
  3. Open CMD/PowerShell as administrator and enter diskpart:
diskpart
  1. Select the VHD by path (replace ):
Select vdisk file="<pathToVHD>"
  1. View the current virtual size:
detail vdisk
  1. Decide the new size in MB (for example, from 512 GB to 1024 GB → 1024000 MB) and expand:
expand vdisk maximum=<sizeInMegaBytes>
  1. Exit diskpart, boot the distro and force the resizing of ext4:
sudo mount -t devtmpfs none /dev
mount | grep ext4
# Identifica el dispositivo, por ejemplo /dev/sdb
sudo resize2fs /dev/sdb 2048000M

After this, the ext4.vhdx file will have the new size and df -h will reflect more available space.

Troubleshooting common problems with wsl –mount

A common error when mounting from PowerShell is: "The disk connected but could not be mounted (code -22) ." Run `dmesg` within WSL for more details. Messages like "EXT4-fs: VFS: Can't find ext4 filesystem" usually indicate that you're not targeting the correct partition, the volume isn't ext4, or you need to use `-bare` and mount manually.

If you connect the drive using a USB enclosure or adapter , remember that `wsl --mount` does not support USB. Even if `lsblk` shows sdd, sde, etc., automatic mounting may fail for that reason. In that case, try these guidelines:

  • Attached with –bare and check partitions in WSL: lsblk and sudo blkid /dev/sdXN.
  • If the file system is not ext4 (e.g., xfs, vfat), indicate –type while riding.
  • If the disk uses LVM, RAID or encryption, wsl –mount will not handle it directly.
  • Check the partitioning style (MBR/GPT) and that the index passed with –partition be the correct one.
  How to Disable Fast Boot Without Accessing BIOS in Windows

Another scenario is booting the distribution in read-only mode after a power outage: you'll see the message "An error occurred mounting the distribution disk; it was mounted read-only as a fallback" and you won't be able to write to it. To fix this, do the following from PowerShell as administrator:

  1. WSL closes: wsl.exe –shutdown
  2. Mount the distro's VHD in bare mode:
wsl.exe --mount <path-to-ext4.vhdx> --vhd --bare
  1. Identify the device with wsl.exe lsblk and repair with e2fsck (replace ):
wsl.exe sudo e2fsck -f /dev/<device>
  1. Disassemble: wsl.exe –unmount and restart the distro.

If you need to locate the ext4.vhdx file of a specific distro, run the following command in PowerShell:

(Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | Where-Object { $_.GetValue("DistributionName") -eq '<distribution-name>' }).GetValue("BasePath") + "\ext4.vhdx"

Finally, if you're on Windows 10 and don't see the functionality, keep in mind that wsl --mount support originated in Insider builds (like 20211) and later arrived via WSL in the Microsoft Store . Install the WSL version from the Store and update with wsl --update to get the latest features, or upgrade to Windows 11.

Useful WSL commands that will save you time

To keep the environment up to date, you can manually update the WSL kernel and revert if something doesn't suit you:

wsl --update
wsl --update rollback

Shut down all instances (ideally before resizing VHDs or mounting VHDXs): `wsl --shutdown` . If a distro hangs, terminate it automatically:

wsl --terminate <NombreDistro>

To migrate or back up , export to a TAR file and import a new distro to a different location. You can even choose WSL 1 or 2 during the import process.

wsl --export <NombreDistro> backup-wsl.tar
wsl --import <NombreDistroNueva> C:\wsl\debian backup-wsl.tar --version 2

If you're going to reinstall a distro from scratch, remember that `--unregister` removes all data associated with that instance:

wsl --unregister <NombreDistro>

And when you need to mount or unmount from Windows, always have the quick reference for the mount command itself handy :

# Montar disco físico completo en ext4 (por defecto)
wsl --mount \\.\PHYSICALDRIVEX

# Adjuntar sin montar para decidir después
wsl --mount \\.\PHYSICALDRIVEX --bare

# Montar partición concreta y tipo específico
wsl --mount \\.\PHYSICALDRIVEX --partition 1 --type ext4

# Montar VHD/VHDX
wsl --mount C:\\ruta\\disco.vhdx --vhd

# Desmontar (uno o todos)
wsl --unmount \\.\PHYSICALDRIVEX
wsl --unmount

With all of the above, you have a powerful workflow at your fingertips: access ext4 disks, work with VHDs, expand storage, and repair errors without leaving Windows. WSL 2 integration has matured enough to be a stable solution for developers and administrators who move between both environments.

How to access Linux partitions from Windows 11
Related articles:
How to access Linux partitions from Windows 11: WSL, network, and apps