WhitewaterFoundry / Pengwin

A Linux distro optimized for WSL based on Debian.
Other
1.48k stars 105 forks source link

Fstab is not generated upon installation #600

Open WSLUser opened 4 years ago

WSLUser commented 4 years ago

Describe the bug A clear and concise description of what the bug is. In /etc/wsl.conf, we have fstab configured as on but if you take a look at /etc/fstab, the file does not exist. To Reproduce Steps to reproduce the behavior: Install Pengwin from Store or wsl --import

Expected behavior A clear and concise description of what you expected to happen.

I expect fstab to have the mount options configured. In my case, I only have one drive: C:\ but in other cases, there could be multiple.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here. This is configured when creating the docker bridge as the mounts are not just created for /mnt/c but also /c. I would suggest that adding some steps when creating wsl.conf, to create /etc/fstab as we do when selecting docker for WSL1. However, in this case, we will only create /mnt/c and others based on available drives. If we export Pengwin, when we import on another machine (which will have a different computer name we can check for), it should check if those drives still exist and remove the entries that are no longer relevant (/mnt/c will always exist so we can ignore that). I have found that when the drives are mounted via fstab, that mounting of the drives is a bit faster when opening a new WSL session when there are no other WSL sessions (i.e. after a reboot or upon first time WSL is installed).

Basic Troubleshooting Checklist

[ ] I have searched Google for the error message. N/A [ ] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled. N/A [ ] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues. N/A [x] I have searched the Pengwin issues page: https://github.com/WhitewaterFoundry/Pengwin/issues. [ ] I have reset Pengwin: Settings->Apps->Apps & features->Pengwin->Advanced Options->Reset. N/A [ ] I have disabled and re-enabled WSL in Windows Features. N/A [ ] I have run Windows 10 updates and restarted. N/A

What other troubleshooting have you attempted?

I found the previous mounts on the machine that Pengwin was originally on was still listed. This caused an issue after a few wsl --terminate in which access to Windows (via directory navigation, interop, and 9P file explorer) were broken. This occured after installingtask-kde-desktop. This was when I found /etc/wsl.conf was configured to use fstab but /etc/fstab was not created. I also wasn't able to rm -rf the /mnt directories (I had 2 others besides C:\ on the other machine).

Insert here:

Pengwin Version

Find: Settings->Apps->Apps & features->Pengwin->Advanced Options->Version.

Insert here: N/A (using imported build with latest dev packages based on latest release in MS Store)

Windows Build

Run 'systeminfo | findstr /C:"OS"' in Command Prompt and insert here: 10.0.18363 N/A Build 18363

For help on retrieving: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#check-your-build-number

WSLUser commented 4 years ago

@crramirez FWIW, I think we were actually generating /etc/fstab after install from the MS Store. I don't think this is the case anymore and not sure when that behavior changed. But adding logic in the case we import a duplicate would be a new feature but one I think we should do.

crramirez commented 4 years ago

Hello @WSLUser,

We explicit don't instruct Pengwin to generate or install /etc/fstab. In the last image is being made from any Debian package installed. We put mountFsTab = true in /etc/wsl.conf as a helper if anyone creates or fills the fstab and doesn't remember to set this option in wsl.conf.

The change that pengwin-setup does for docker is modifying /etc/wsl.conf and adding:

[automount]
root=/

We tried at first modifying the fstab to avoid changing the root mount point, but it was a mess.

Windows automatically add any drive to /mnt without modifying the fstab. And the upcoming WSLU 3 will add mount points for network mounted drives modifying the fstab.

I couldn't understand well your requirement, so I am giving all the information that I have. Please explain more in-depth your need.

Regards, Carlos

WSLUser commented 4 years ago

And the upcoming WSLU 3 will add mount points for network mounted drives modifying the fstab

Just add local mounts to this process and check if those drives exist still when starting up Pengwin again. Optimally it will also remove drives from etc/fstab if they do not appear to exist (either because it was a usb drive that was disconnected or a different machine with less drives available.).

crramirez commented 4 years ago

Ok and the reason for doing this is that you found that if the drives are declared in fstab the cold start is faster than if this file is empty?

WSLUser commented 4 years ago

Correct. Of course this probably is determined by the individual computer/VM/cloud instance. It just happens to appear to work faster on my older laptop.

WSLUser commented 4 years ago

Also it has been a expectation ever since WSL was first announced to use fstab. Check out the Reddit and SO threads. So it makes sense that as Pengwin seeks to optimize WSL for developers, that it would do this for them.