The Problem
Indexing search for locate was very slow, sometimes maybe infinetely. Idexing was starting up by sudo updatedb, but not finishing.
The Hypothesis
As seen via mount command in WSL, there were mounted several drives slowing down indexing search for locate:
- C: (default system drive of Windows host) - needed sometimes
- G: (drive from Google Drive File Stream) - however, not working correctly
- multiple (?) N: drives (resulted from these last month experiments) - not needed already
I wanted to unmount and keep them unmounted.
The Solution
The /etc/wsl.conf was not existing initially in WSL (ls -al /etc/wsl.conf), so created it this way
sudo bash -c "echo [automount] >> /etc/wsl.conf"
sudo bash -c "echo enabled=false >> /etc/wsl.conf"
sudo bash -c "echo [automount] >> /etc/wsl.conf"
sudo bash -c "echo enabled=false >> /etc/wsl.conf"
Restart WSL instance via Windows command-prompt (cmd.exe):
wsl --list --running
wsl --terminate "Ubuntu-18.04"ubuntu1804
wsl --list --running
wsl --terminate "Ubuntu-18.04"ubuntu1804
Now we see in WSL via mount, that those Windows drives in WSL are not mounted, and sudo updatedb is remarkably faster.
Drives can be mounted and unmounted on demand - example:
sudo mount -t drvfs C: /mnt/c
sudo umount /mnt/c
More information about wsl.conf: https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/.
sudo mount -t drvfs C: /mnt/c
sudo umount /mnt/c
More information about wsl.conf: https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/.
Žiadne komentáre:
Zverejnenie komentára