3

I would like to mount drive D on /home directory in WSL while letting C drive to be mounted on /mnt or not mounting it at all. How can I do that?

3

I figured it out. There is a setting to mount manually instead of automount.

To disable [automount] I should set enable key in wsl.conf to false. Here is my /etc/wsl.conf:

[automount]
enabled=false
mountFsTab=true

Also, I should have added the following line to fstab.

D:  /home   drvfs   defaults    0 0

and it did work. Just do not forget to have .bashrc and .profile in your D drive.

| improve this answer | |
  • Does Windows 10 has to be up to a certain version? I have version 1709 (OS Build 16299.1268), with these in /etc/wsl.conf: [automount] // enabled = false // mountFsTab = true // ... and an /etc/fstab file, it doesn't seem to work. – Wei Wang Aug 9 '19 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.