Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--mount support for USB flash drives #6011

Open
HoFamilyMaker opened this issue Oct 1, 2020 · 66 comments
Open

--mount support for USB flash drives #6011

HoFamilyMaker opened this issue Oct 1, 2020 · 66 comments
Assignees
Labels

Comments

@HoFamilyMaker
Copy link

HoFamilyMaker commented Oct 1, 2020

upgrade to build 20226
run this command wsl --mount
receive the error 'The remote procedure call failed'

image

Originally posted by @HoFamilyMaker in #6008 (comment)

@HoFamilyMaker HoFamilyMaker changed the title mounting a linux disk in WSL 2 after update to 20226 can't moun a linux disk in WSL 2 after update to build 20226 Oct 1, 2020
@HoFamilyMaker HoFamilyMaker changed the title can't moun a linux disk in WSL 2 after update to build 20226 can't mount a linux disk in WSL 2 after update to build 20226 Oct 1, 2020
@OneBlue
Copy link
Collaborator

OneBlue commented Oct 1, 2020

Hi @HoFamilyMaker,
Thanks for reporting this.

This issue has already been identified and will be fixed in an upcoming insider build.

Out of curiosity, what kind of disk are you trying to mount ?

@markwill890
Copy link

Is this related to being able to access a WSL folder of the form...

\wsl$\docker-desktop-data\mnt\wsl\docker-desktop-data\data

with "Attempt to access invalid address" (this has been my Quick Access list in Explorer so I now it WAS the right folder).

Curiously, if I drill down to this folder in Explorer I can see the folder but it is now empty.

I have been using this for months, to edit in VS.Code. As of today, though, that folder is empty and I can no longer access the WordPress plugin I have been developing, since I can't access from VS.Code.

Strangely, though, the web site that is supposedly running from their (localhost) remains available. I'm really confused so any help would be really appreciated.

@HoFamilyMaker
Copy link
Author

HoFamilyMaker commented Oct 1, 2020

Hi @HoFamilyMaker,
Thanks for reporting this.

This issue has already been identified and will be fixed in an upcoming insider build.

Out of curiosity, what kind of disk are you trying to mount ?

Thanks

I found this
https://docs.microsoft.com/en-us/windows/wsl/wsl2-mount-disk

Limitations
USB flash drives are not supported at this time and will fail to attach to WSL 2. USB disks are supported though.

my disk is USB flash
change to USB disks (SSD) run wsl --mount is OK

image

image

@HoFamilyMaker
Copy link
Author

HoFamilyMaker commented Oct 1, 2020

@HoFamilyMaker can you please update to the latest Insider build and try again to see if your problem is resolved?

You'll want to be on preview build 20226 or higher.

Thanks

My windows 10 is latest Insider build 20226
image

I found this

Limitations
USB flash drives are not supported at this time and will fail to attach to WSL 2. USB disks are supported though.

try wsl2 to mount USB flash receive the error 'The remote procedure call failed'
mount extend USB disk is OK

@craigloewen-msft
Copy link
Member

My apologies @HoFamilyMaker I realize that the fix is not yet in Insiders, but thank you for updating! As @OneBlue mentioned we have a fix incoming for this soon, we'll ping this thread when it's available in the latest Insider build.

@therealkenc therealkenc changed the title can't mount a linux disk in WSL 2 after update to build 20226 --mount support for USB flash drives Oct 2, 2020
@Imperatorn
Copy link

Need this so much!

Can't do wsl --mount \.\PhysicalDrive1 :(

@mengesb
Copy link

mengesb commented Nov 26, 2020

I too am affected by this issue. Would really like to manipulate my linux partitions without additional software like Paragon. native support would be excellent.

Guessing this goes for the following as well:

PS C:\Windows\System32> wmic diskdrive list brief
Caption                       DeviceID            Model                         Partitions  Size
INTEL SSDSC2BA400G4           \\.\PHYSICALDRIVE0  INTEL SSDSC2BA400G4           4           400085844480
SanDisk Ultra Fit USB Device  \\.\PHYSICALDRIVE1  SanDisk Ultra Fit USB Device  3           15373048320

PS C:\Windows\System32> wsl --mount \\.\PHYSICALDRIVE1 --bare
The system cannot find the drive specified.
PS C:\Windows\System32> wsl --mount \\.\PHYSICALDRIVE1 --partition 3
The system cannot find the drive specified.

I tried also with my SD card device, but that's definitely flash memory.

@BakedCrossiant
Copy link

Any update?

@craigloewen-msft
Copy link
Member

Hey folks, wanting to add some clarity here since I realize that my last comment was not very clear. We added a fix for the 'remote procedure call failed' which was the immediate blocker for this in the root issue. However WSL --mount does not yet have support for USB flash drives formatted in Linux file formats. If you'd like to mount a flash drive in WSL you can do that if it's seen in Windows (in other words, if it's formatted in a file format that Windows understands like NTFS) using sudo mount -t drvfs f: /mnt/usbDrive if you have a USB flash drive as F: on windows. As of right now we do not have support for USB flash drives formatted in other file formats that Windows can't understand. In the future we'll be investigating adding support for flash drives to wsl --mount as a feature request for future iterations, but this is currently a backlog request.

@kb3mkd
Copy link

kb3mkd commented Apr 8, 2021

The reason I want wsl to work is so I can work on Raspberry pi drives from my Windows PC or laptop.

@Imperatorn
Copy link

I want this so I can dd

@laszewsk
Copy link

laszewsk commented Jun 7, 2021

It would be great to get more clarification on this if It now works or not. I am confused if it works or not.

Use case why we like this feature:

A bunch of us seem to want to get access to the Raspberry PI sdcards so we can manipulate them. Originally we wanted to use wsl2 (the development version but the person working on this failed o get it working). Thus we developed an alternative in for gitbash at https://github.com/cloudmesh/cloudmesh-pi-burn in the branch https://github.com/cloudmesh/cloudmesh-pi-burn/tree/windows
This is so we can in the meanwhile access the boot partition in windows directly.
For this we developed a Diskpart class and it works reasonably well (not everything is yet working. we have not done the write part yet). HOwever if we were to have this in wsl2 we could do something like https://cloudmesh.github.io/pi/tutorial/raspberry-burn/ directly in wsl2.
Right now we use gitbash.

I think many of us using the Pi for education would really appreciate a clarification about the status of this. Thanks

@craigloewen-msft
Copy link
Member

@laszewsk as of right now --mount does not support USB flash drives if they are formatted in a Linux file format. This issue is left open to track this request. Please see this comment for full details: #6011 (comment)

@Bluscream
Copy link

Can someone tell me how to do this please? I need to fsck my raspi card

@laszewsk
Copy link

laszewsk commented Jan 5, 2022

you could do a boot from a live linux CD and then use fsck from that.

In case you like to burn multiple SD Cards for a PI cluster, we updated our documentation at

@Bluscream
Copy link

you could do a boot from a live linux CD and then use fsck from that.

In case you like to burn multiple SD Cards for a PI cluster, we updated our documentation at

Thanks, i've tried that but it was unable to fix my card through Parted and commandline

@blockfeed
Copy link

+1, this feature is critical for anyone doing embedded development (and relies on transfers from SD cards via USB adapter).

@luizoti
Copy link

luizoti commented Apr 3, 2022

Same thing here, when using an sd card with adapter.

+1, this feature is critical for anyone doing embedded development (and relies on transfers from SD cards via USB adapter).

@AlexeiScherbakov
Copy link

Workaround is use Usb Reader (notebook integrated not allways works) + VMWare with Debian and GParted
You can install VMWare Player, becase it now works with WLS2, but without hardware accelleration

@Eugene-Lam
Copy link

Eugene-Lam commented Jun 2, 2022

Same here, not working using USB reader

DeviceID           Caption                          Partitions Size          Model
--------           -------                          ---------- ----          -----
\\.\PHYSICALDRIVE0 Samsung SSD 970 EVO Plus 1TB     3          1000202273280 Samsung SSD 970 EVO Plus 1TB
\\.\PHYSICALDRIVE2 Lexar SD  WorkflowUR2 USB Device 2          15924142080   Lexar SD  WorkflowUR2 USB Device
\\.\PHYSICALDRIVE3 Lexar SD  WorkflowUR2 USB Device 0                        Lexar SD  WorkflowUR2 USB Device
\\.\PHYSICALDRIVE1 Lexar SD  WorkflowUR2 USB Device 0                        Lexar SD  WorkflowUR2 USB Device

PS C:\Users\Eugene> wsl --mount \\.\PHYSICALDRIVE2
The system cannot find the drive specified.

laptop buildin sd card slot not working too

PS C:\Users\Eugene> wmic diskdrive list brief
Caption                       DeviceID            Model                         Partitions  Size
Samsung SSD 970 EVO Plus 1TB  \\.\PHYSICALDRIVE0  Samsung SSD 970 EVO Plus 1TB  3           1000202273280
PciE SDHC-Card                \\.\PHYSICALDRIVE1  PciE SDHC-Card                2           15924142080

PS C:\Users\Eugene> wsl --mount \\.\PHYSICALDRIVE1
The system cannot find the drive specified.

@josh-hetland
Copy link

+1 on the desire to interact with my Pi SD card from windows

@laszewsk
Copy link

laszewsk commented Jun 5, 2022

We just released a new version of cloudmesh-pi-burn: https://cloudmesh.github.io/pi/tutorial/raspberry-burn-windows/
Although we use it for clusters, it can be used to burn a single card. However, the full potential is provided when you burn a cluster directly on the SD Cards, plug them in, switch the pis on and you have a readily configured cluster in your network.
It does not burn in WSL2, BUT it burns on Windows, macOS, and Ubuntu. We use this regularly. Just in case you need a SLURM cluster, we just added documentation on how to do that here https://github.com/cloudmesh/cloudmesh-slurm#readme. We welcome contributions and improvements. We have used this code over the last 2 years and improved upon so it works now with the 64 bit OS.

@Michael-Gibbons
Copy link

Same issue for me, sd and sd card reader

@Easampson
Copy link

Same issue, please provide a solution via wsl or enable ext4 support

@Cpt-Dingus
Copy link

Hello, hoping this will bump the issue.
Currently experiencing the same thing with a standard USB drive.

`PS C:\Users\Meti> Get-CimInstance -query "SELECT * from Win32_DiskDrive"

DeviceID Caption Partitions Size Model


\.\PHYSICALDRIVE2 WDC WD10JPVT-00MS8T0 1 1000202273280 WDC WD10JPVT-00MS8T0
\.\PHYSICALDRIVE0 CT500MX500SSD1 3 500105249280 CT500MX500SSD1
\.\PHYSICALDRIVE3 Kingston DataTraveler 3.0 USB Device 2 30943503360 Kingston DataTraveler 3.0 USB Device
\.\PHYSICALDRIVE1 Apacer AS350 240GB 2 240054796800 Apacer AS350 240GB

PS C:\Users\Meti> wsl --mount \.\PHYSICALDRIVE3 --bare
The system cannot find the drive specified.`

@LCC-gblack
Copy link

This is still an issue for me.

@dremsol
Copy link

dremsol commented Feb 4, 2023

Same here as explained in #8885

@absolutelynothelix
Copy link

imagine it's still not fixed

@liamness
Copy link

liamness commented Feb 7, 2023

Was trying to use WSL to copy games and other things over to an SD card formatted for a Steam Deck. Saw the following behaviour:

> wsl --mount \\.\PHYSICALDRIVE1 --partition 1
The system cannot find the drive specified.
Error code: Wsl/Service/AttachDisk/0x8007000f

@longxk
Copy link

longxk commented Feb 8, 2023

Two years later, still not fixed.

PS C:\Users\Loong> wsl --mount \\.\PHYSICALDRIVE2 --bare
系统找不到指定的驱动器。
Error code: Wsl/Service/AttachDisk/0x8007000f

@TheR3d0ne
Copy link

Same problem here:

C:\Windows\System32>wsl --mount  \\.\PHYSICALDRIVE2 --bare
The system cannot find the drive specified.
Error code: Wsl/Service/AttachDisk/0x8007000f

@pirafrank
Copy link

Hi, same issue here.
running latest WSL2 as of today and Windows 11 Pro 22H2.
Below the output.

PS C:\WINDOWS\system32 ~ wsl --mount \\.\PHYSICALDRIVE1
The system cannot find the drive specified.
Error code: Wsl/Service/AttachDisk/0x8007000f

PS C:\WINDOWS\system32 ~ wsl --mount \\.\PHYSICALDRIVE1 --bare
The system cannot find the drive specified.
Error code: Wsl/Service/AttachDisk/0x8007000f

@akash07k
Copy link

I do not think Microsoft has any fix for this in their roadmap as of now.
there is no benefit of commenting on this issue unless we directly mention someone from the WSL2 team who can get it implemented.

@akash07k
Copy link

akash07k commented Feb 13, 2023

@benhillis and @OneBlue Can you please help in this getting it fixed?
It will be very helpful.

I do not think Microsoft has any fix for this in their roadmap as of now. there is no benefit of commenting on this issue unless we directly mention someone from the WSL2 team who can get it implemented.

@knightian
Copy link

Still cannot do it lol

@ndemarco
Copy link

Two years later, still not fixed.

PS C:\Users\Loong> wsl --mount \\.\PHYSICALDRIVE2 --bare
系统找不到指定的驱动器。
Error code: Wsl/Service/AttachDisk/0x8007000f

It's a feature request. It can't be 'fixed' because it was never broken.

@absolutelynothelix
Copy link

@ndemarco, it’s broken because it’s not only about flash drives. i can’t even mount my hdd.

@ndemarco
Copy link

@absolutelynothelix this issue relates to mounting USB flash drives, not hdd / ssd.

@absolutelynothelix
Copy link

absolutelynothelix commented Feb 28, 2023

@ndemarco, it's just a user assumption that the issue is related to a particular kind of drives. we don't know how it's implemented and we can't say that the issue is in the type of a drive being mounted. my bad, read the thread carefully. can't find an issue that covers my problem, so i'll probably create a new one when i'll be on windows.

@Imperatorn
Copy link

Is anyone at Microsoft aware of this issue?

@sambartle
Copy link

Probably. But clearly they don't care about it.

@lanlach
Copy link

lanlach commented Mar 8, 2023

Would really like to see this functionality implemented soon

@Animesh-Thakur
Copy link

Leaving a comment to get notifications for this, till now, I've tried recompiling the kernel using the guide from this link https://www.youtube.com/watch?v=iyBfQXmyH4o , but this does not work for my internal sd-card reader which shows up as this when usbpid is used and the command usb-devices is run in Ubuntu (or kali)
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=0bda ProdID=0177 Rev=77.11 S: Manufacturer=Generic S: Product=USB2.0-CRW S: SerialNumber=20121112761000000 C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none) E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

@akash07k
Copy link

@Animesh-Thakur Nice, so is USB support working now in your WSL distros and kernel?

Leaving a comment to get notifications for this, till now, I've tried recompiling the kernel using the guide from this link https://www.youtube.com/watch?v=iyBfQXmyH4o , but this does not work for my internal sd-card reader which shows up as this when usbpid is used and the command usb-devices is run in Ubuntu (or kali) T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=0bda ProdID=0177 Rev=77.11 S: Manufacturer=Generic S: Product=USB2.0-CRW S: SerialNumber=20121112761000000 C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none) E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

@Animesh-Thakur
Copy link

I had to look around the menuconfig for a bit and set another flag for my internal card reader to work, and yes, it does work, unfortunate it isn't the default behaviour though

@dewijones92
Copy link

I found what worked for me best was to delete windows and install ubuntu

@akash07k
Copy link

Great, can you share your kernel so that I can quickly check if it works for me?
Later will build it for myself.

I found what worked for me best was to delete windows and install ubuntu

@knightian
Copy link

I found what worked for me best was to delete windows and install ubuntu

🤣 True

@Animesh-Thakur
Copy link

Animesh-Thakur commented Mar 27, 2023

Great, can you share your kernel so that I can quickly check if it works for me? Later will build it for myself.

I found what worked for me best was to delete windows and install ubuntu

Can't upload kernel to something which I'll feel comfortable sharing, might write my step by step when I have time, but that'll have to wait, hope you can work it out without my help, because I won't count on it.

PS. can't upload it on GH, size too large

@akash07k
Copy link

akash07k commented Mar 27, 2023 via email

@bengalih
Copy link

bengalih commented May 7, 2023

Just wanting to clarify here and maybe help serve as a reminder for anyone else coming to this thread that hasn't read all the way through:

  • Waited well over a year for the following issue to be resolved and "mount" ported from insider builds to the wslstore release:
    --mount option available on Win10 (non-Insider) #7940

  • Now that wsl --mount can be used on Windows 10 natively, I get:
    The system cannot find the drive specified

This is because , according to this issue, USB flash drives (which is what I needed to mount all along) are still not supported even after almost 3 years of this issue being open?!
(I can't be sure, but it also appears that the built-in mount option also does not support mounting non-windows formatted filesystems???)

Currently, WSL 2 does not support USB devices by default.

However, their support wiki page also states:

Recent versions of Windows running WSL kernel 5.10.60.1 or later already include support for common scenarios like USB-to-serial adapters and flashing embedded development boards. If you're trying to do one of these tasks on Ubuntu, you can avoid recompiling the kernel by following the WSL Setup instructions at the top of this page. If you require special drivers, you'll need to build your own kernel for WSL 2.

I'm still running off the kernel I compiled with no issues, but it seems that some users may not need to compile their own kernels.

In short, it seems that the "wsl --mount" option is still severely lacking in functionality and that usbipd-mount may be the preferable solution.

Is there any advantage, if USB support is now compiled into WSL kernel and therefore usbipd-win setup is very easy to use "wsl --mount" over usbipd-win?

With usbupd-win I was able to perform block-level operations against a mounted USB flash drive. I would think that most other operations would build on top of that and not have issues.

If it were up to me, at this point, I would recommend the use of usbipd-win in any scenario due to my experience and the limitations of "wsl --mount". With the exception of 5 minutes of setup, there seems to me no disadvantage. However I am but one user and admittedly do not understand the full scope of the underlying architecture between the two choices.

Can anyone speak to how/why/when "wsl --mount" would be a superior option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests