microsoft / microsoft/WSL

Add support for mount ext4 USB flash drive to WSL

Open
#6,392 5 comments 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

As mentioned in the documentation, this feature is currently not supported with the new option wsl --mount but it is very useful when you need to access a Linux filesystem inside an SD card (Raspian for example) attached with a USB adapter.

This is the error:

PS C:\Windows\System32> wmic diskdrive list brief
Caption                          DeviceID            Model                            Partitions  Size
NVMe Samsung SSD 970             \\.\PHYSICALDRIVE0  NVMe Samsung SSD 970             3           500105249280
Generic Mass-Storage USB Device  \\.\PHYSICALDRIVE1  Generic Mass-Storage USB Device  2           32004564480

PS C:\Windows\System32> wsl --mount \\.\PHYSICALDRIVE1 --bare
Impossibile trovare l'unità specificata.
PS C:\Windows\System32>

The ext4 filesystem inside the SD card is not visible in Windows, so:

giuseppe@DESKTOP-J4Q83NF:/mnt/c/Windows/System32$ sudo mount -t drvfs D: /mnt/d
[sudo] password for giuseppe:
<4>WARNING: mount: waiting for virtio device...
<3>init: (14) ERROR: MountPlan9WithRetry:285: mount drvfsa on /mnt/d (cache=mmap,rw,msize=262144,trans=virtio,aname=drvfs;path=D:;symlinkroot=/mnt/) failed: 2
mount: No such file or directory
giuseppe@DESKTOP-J4Q83NF:/mnt/c/Windows/System32$

Thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the documented wsl --mount behavior and the reported wsl --mount \\.\PHYSICALDRIVE1 --bare command. Investigate how WSL handles USB disks and ext4 filesystems; done means an ext4 filesystem on an attached USB or SD-card device can be mounted without the reported device-not-found error.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.