-
Notifications
You must be signed in to change notification settings - Fork 821
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
Automount additonal filesystems from fstab #2636
Comments
#511 #994 et al. User Voice is here. You've basically got the present situation. Work around with |
Great, thanks for the info! |
Thanks for the suggestion. This is definitely on our radar, and we're looking into the best ways to address this. |
Just a little sidenote, I wrote a script that gets around this problem so you might find it useful: https://github.com/leongrdic/easyWSLbash |
adding the mount command" returns the following message" so this workaround is not working? |
did you specify the mountpoint in /etc/fstab? If so, it should be sufficient to simple add |
I got fustrated with not being able to automount removable usb drives so I wrote this: |
Please stand by, support for this is coming soon! |
@SvenGroot brilliant news, keep us posted |
It's out now for build 17093 |
Patch notes for build 17093 doesn't appear to include support for removable drives which is what the above script does. |
I'm not sure how can I automount a partition mounted as empty directory from Windows on WSL. I added in my fstab:
But when I call
Mounting it manually also works fine:
If needed, I'm on 17093. |
Just how far does fstab support go? Could I mount my cd drive without a cd in it (empty directory) for example? This would be useful for doing things such as mounting iso files that you could then run to install. (Getting the Windows side |
@DarthSpock - We are running 'mount -a' so anything you can do on native Linux with /etc/fstab you should be able to do (provided we support the filesystem type). |
Marking as fixed in 17093. |
Looking forward to when there is more filesystem support starting with "F" then. Edit: There's a uservoice for it that's not related to this issue. |
@dgadelha I don't think you can escape backslashes using single quotes in fstab. You need to either double the backslashes, or use forward slashes (which are now also accepted). |
@SvenGroot Thanks! That fixed the |
The main issue for me on this new support is that only works at wsl startup. @SvenGroot is there anything in the pipeline for proper automount support (similar to my wsl_automount above) so that when a drive is inserted, if a wsl session is running and it's in the fstab it gets mounted/unmounted? |
That's #560. |
Microsoft Windows [Version 10.0.16299.309]
But no options works fine... just mounts as "root"
|
@cdenneen fstab and extended metadata attributes aren't in 16299. You will need to be on Insiders or wait for the next stable release coming soon and upgrade. |
@DarthSpock yeah sorry I meant to post that I was going to pull down latest insider shortly to confirm... was hoping would have been released by now but stable is still < 17xxx for a while now... maybe fixes... so I'll start using insider. Thanks |
Confirmed Looks like symlinks are not supported under drvfs?
|
@DarthSpock thanks... I tried the elevation and it didn't fix the symlink. |
What kind of file system is H:? Symlinks only work on local NTFS drives.
|
H: is mapped drive to \localhost\home which is C:\home |
@cdenneen That means you are using SMB for this mount, which has many more restrictions. Among other things, it does not support symbolic links, metadata, or case sensitivity. It's also much slower. Since you're mounting localhost, I would suggest using C:\home directly. Since DrvFs won't let you directly mount a directory that's not the root of a drive, the way to do is to use a bind mount: Or, in fstab (note you have to explicitly mount C: first since we process fstab before automounting DrvFs):
I also recommend using the "metadata" option for this use case, as it allows chmod/chown to work. |
@SvenGroot I don't have a C: in my fstab but it is mounted... here is what I have:
wsl.conf
symlinks are working now... are there any other mount options I should have in |
You have to add C: to your fstab. We process fstab before we automount your drives, so with your current setup /mnt/c will not be mounted yet when we attempt to create the bind mount. |
@SvenGroot thanks... i'll look to add to match above... i'm wondering how it's already there on all my WSL's ... thought it was a "given" rather than needing explicit addition to |
@cdenneen - When /etc/fstab support was added we run mount -a before adding any DrvFs mounts. This allows you to customize your mount behavior instead of relying on our defaults. |
I've got fstab working as expected, but I need things mounted at /c and not /mnt/c given how WSL converts paths (which affects Docker users). I'm still getting the drives mounted at /mnt. To be clear (though I assume it has to do with WSL.conf), what controls if they're mounted at all and what controls the fact that they're mounted at /mnt? |
@benhillis May be it's time to apply @therealkenc's idea to create |
@benhillis Thank you. |
@Biswa96 - It's not a bad idea, but as a rule we try to limit the number of filesystem changes we make to the user's root file system to things that are required for functionality (/etc/hosts, /etc/resolv.conf, etc). |
Maybe generating No... wait. |
Is it possible to automount drives at multiple paths? If so, what are the exact steps to doing this? Since 18.03 I've been using So, as a work around, is there any way to set both The end result I'm looking for would be that |
You can add both mounts in fstab. In wsl.conf, set using fstab to yes. This will load it before loading the auto mount option. Straight from CLI, I can do an |
@DarthSpock What would the |
I looked at those but it's not working. I edited my
Then I ran |
@nickjj - Make sure that /mnt/c exists (mkdir /mnt/c). |
@benhillis Thanks, now it's working (both the mount and VSCode's Git integration). |
With the latest update the new functionality to mount e.g. a sd-card came into the WSL (using drvfs).
While this works fine when performing a manual mount, it would be very helpful to have a possibility to automount devices (e.g. through an entry in fstab).
I added the following line to fstab and can now mount the sd-card using
mount -a
:Is there any undocumented functionality to allow an automount or is there a place, where I can add a script that helps?
.bashrc
might be an idea, but this would require some messing around with the sudo command as I don't want to be asked for the password on startup (but mount -a requires su).Thanks in advance!
Microsoft Windows [Version 10.0.16299.19]
The text was updated successfully, but these errors were encountered: