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

Drives other than C: are not mounted in /mnt #1079

Closed
vmsh0 opened this issue Sep 14, 2016 · 31 comments
Closed

Drives other than C: are not mounted in /mnt #1079

vmsh0 opened this issue Sep 14, 2016 · 31 comments

Comments

@vmsh0
Copy link

vmsh0 commented Sep 14, 2016

Drives other than the C: drives are not mounted under /mnt.
I have two more fixed drives, D: and V:, and they are not being mounted. They are both exFAT drives.

I'm on Windows 14393.105.

@rodrymbo
Copy link

rodrymbo commented Sep 14, 2016

Sounds like #891, if the system thinks the drives are removable.

If they are not removable, but mounted after the first long-running bash.exe starts, the WSL environment won't see them (e.g mounting a drive with VeraCrypt). The workaround is to mount the drives before using bash.exe. Or maybe non-NTFS drives are not mounted, I can't find a reference for that...

Found it: only NTFS and ReFS filesystems are supported, which makes it similar to #801.

Not saying it's a good thing that only NTFS is supported; it certainly would make things much more usable if (a) any drive Windows can mount would mount in WSL somehow and (b) linux filesystem drivers like ext3/4 could be used to mount other drives into WSL.

@vmsh0
Copy link
Author

vmsh0 commented Sep 14, 2016

I do not think the system sees them as removable, they have the fixed drive icon and don't have an "Eject" option. They are not mounted in any special way either.

@benhillis
Copy link
Member

Currently only fixed NTFS drives show up under /mnt/.

@iz0eyj
Copy link

iz0eyj commented Sep 14, 2016

@streamholder This is my /mnt:
federico@BESTIA:/mnt$ ll
totale 24
drwxr-xr-x 2 root root 0 set 14 19:11 ./
drwxrwxrwx 2 root root 0 set 2 14:34 ../
drwxrwxrwx 2 root root 0 set 14 19:08 c/
drwxrwxrwx 2 root root 0 set 14 01:29 d/
drwxrwxrwx 2 root root 0 set 13 22:04 x/
federico@BESTIA:/mnt$

All the drive is NTFS, X is an external unit (I don't know what program mounts it).
I have also many dir mapped on the Win side (symlink).

@vmsh0
Copy link
Author

vmsh0 commented Sep 14, 2016

@benhillis I understand that. My D: and V: drives are fixed.

@benhillis
Copy link
Member

benhillis commented Sep 14, 2016

You also said they are exFAT (not NTFS) correct? That's why they aren't showing up.

@vmsh0
Copy link
Author

vmsh0 commented Sep 14, 2016

@benhillis That is correct, and that also doesn't make the removable drives by any classification. Windows doesn't look at the filesystem type to decide whether a drive is fixed or removable (rightly so). The fact that Bash On Windows (or WSL, whichever is at fault) does is a bug.
You may want to undo the closing. This is clearly not a duplicate of #891.

@benhillis
Copy link
Member

benhillis commented Sep 14, 2016

Sorry I inadvertently closed this issue (clicked wrong button) although this issue is discussed elsewhere. WSL currently only supports NTFS drives under /mnt/.

To clarify - In order for a drive to show up under /mnt/ it must meet the following criteria:

  1. The drive must be a fixed drive (your drives satisfy this requirement)
  2. The drive must be formatted to NTFS (your drives to not satisfy this requirement).

@benhillis benhillis reopened this Sep 14, 2016
@iz0eyj
Copy link

iz0eyj commented Sep 14, 2016

@benhillis "1. The drive must be a fixed drive" -> my "x" drive is an external, USB (2.0) drive and is mounted under /mnt.
I don't know what program mounts it, but it is impossible to umount it both from WSL and Win.
To umount I need to shutdown the system then turn it off. :)

@vmsh0
Copy link
Author

vmsh0 commented Sep 14, 2016

@benhillis I did not know about the second requirement. I tried to make a symlink and a junction somewhere on the C drive to the ExFAT drives, but either way it just doesn't show up in Bash.

@iz0eyj
Copy link

iz0eyj commented Sep 14, 2016

@streamholder you need to format using NTFS.

@vmsh0
Copy link
Author

vmsh0 commented Sep 14, 2016

@iz0eyj Yeah - that would be the obvious solution. However, that is not a possibility for me. Those hard disk contain data that has to be easily accessible from other platforms, and ExFAT is the only out-of-the-box solution to do that.

@iz0eyj
Copy link

iz0eyj commented Sep 14, 2016

@streamholder it would be possible for you to create a little NTFS partition for data exchange between WSL and Win?

@vmsh0
Copy link
Author

vmsh0 commented Sep 14, 2016

@iz0eyj Definitely, however that would not be an ideal solution at all, and furthermore it kind of defies the whole usefulness of WSL. Rebooting into Linux whenever I need Bash would be less of a hassle than manually copying data I need to use to a NTFS partition.

@fpqc
Copy link

fpqc commented Sep 15, 2016

@streamholder All platforms (I think except for FreeBSD maybe) support NTFS read/write now. On Mac, you can install a FUSE module or install the third-party ntfs-3g driver, and ntfs-3g on Linux.

@MaxPleaner
Copy link

Would appreciate some advice on how to mount another drive in Bash.

I have a dualbooted Ubuntu and Windows and I want to get Windows Bash to access the Linux partition.

I'm using the Ext2Fsd program in Windows to mount the Linux partition at D:// but I don't know how to make it available to Bash. I tried making a link but it is the .lnk format and I'm not sure what to do with that in Bash.

@aseering
Copy link
Contributor

aseering commented Apr 12, 2017

@MaxPleaner -- WSL unfortunately only supports / allows access to NTFS partitions right now.

@alkis
Copy link

alkis commented Jun 11, 2017

Is this being worked on?

@fpqc
Copy link

fpqc commented Jun 11, 2017

@alkis kinda. Right now each filesystem driver for win32 seems like it might needs to have its own compatibility layer registered generically somehow through drvfs or potentially could make use of an unstable and undocumented kernel-side API to provide functionality to the Linux subsystem. Right now Microsoft's solution allows mounting of most of the filesystems with Windows built-in Win32 support (CDFS, Samba network shares, NTFS, and FAT32) with sort of stripped-down functionality using Microsoft's drvfs. This does not extend to third-party filesystem drivers for now (unless they are a special kind of tricky filesystem that masquerades as NTFS (the Windows BTRFS prerelease driver plays this game).

There are a couple of other topics about this (requests to expose the kernel-side API for driver makers and to add things like the drvfs driver sources to the KMDF) as well as requests for direct support for things like FUSE (possibly implemented on top of the gvflt filter driver from GVFS). A lot of progress was made only a few builds ago that added all of the FAT32, SAMBA, and CDFS stuff.

Mostly speculation, but it seems like they're making moves on these things.

@sunjoong sunjoong mentioned this issue Jun 21, 2017
@alienmind
Copy link

Under WSL, add to /etc/fstab
D: /mnt/d drvfs defaults 0 0

then back to bash:

  1. Create the mount point
    sudo mkdir /mnt/d

  2. Mount it
    sudo mount -a

voila! /mnt/d now points to d:

It works even with non fixed drives

@therealkenc
Copy link
Collaborator

therealkenc commented Dec 9, 2017

Given that the OP predates the WSL filesystem improvements introduced in 16176 I think we can call this closed. It won't mount exFAT fixed drives automatically via init, but that kind of falls under the umbrella startup task topic per #2636 #511 #994. Previously you couldn't mount exFAT drives period.

@cpuschma
Copy link

I recently ran into this error as well. What helped me solving this problem was restarting the LxssManager service

net stop LxssManager && net start LxssManager

@nyanpasu64
Copy link

nyanpasu64 commented Jun 5, 2018

If they are not removable, but mounted after the first long-running bash.exe starts, the WSL environment won't see them (e.g mounting a drive with VeraCrypt). The workaround is to mount the drives before using bash.exe. Or maybe non-NTFS drives are not mounted, I can't find a reference for that...

When will this issue be fixed?

@fpqc
Copy link

fpqc commented Jun 5, 2018

wsl supports loading an fstab, so make one

@renatovassao
Copy link

Windows and WSL2 now supports mouting Linux filesystems

https://devblogs.microsoft.com/commandline/access-linux-filesystems-in-windows-and-wsl-2/

@p-racoon2
Copy link

I created the partition after installing WSL. This helped me might help others as well:-
To Mount :-

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

To Unmount :-

$ sudo unmount /mnt/d

@jknair0
Copy link

jknair0 commented Jan 2, 2021

I recently ran into this error as well. What helped me solving this problem was restarting the LxssManager service

net stop LxssManager && net start LxssManager

this worked for me. Please mention this has to be run in powershell

@therealkenc
Copy link
Collaborator

If folks are experiencing a problem with D:\ not being automounted on WSL2 on 20H2 (or Insiders), contrast whatever was the long resolved issue from 2016, please feel free to spin up a new issue following the submission template. There should not be any requirement for a start/stop or mkdir raindance to get /mnt/d. Be sure to include as many details about your D: as possible.

@caleb15
Copy link

caleb15 commented Apr 17, 2021

@therealkenc I just ran into the same issue with WSL2 and other people have too - see #6286

@gbatra222
Copy link

I created the partition after installing WSL. This helped me might help others as well:- To Mount :-

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

To Unmount :-

$ sudo unmount /mnt/d

When do we use unmount? when we want to unplug the external ssd?

@tfha
Copy link

tfha commented Jan 9, 2023

It should be sudo umount /mnt/d right? Ie. not unmount. I get error on that.

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

No branches or pull requests