5

I have a folder on Windows C:/Users/macie/dev and I want to mount it on /home/maciek/dev on WSL (Ubuntu). It stops working after restarting Windows. How do I make the mount permanent?

Here's my /etc/fstab file:

LABEL=cloudimg-rootfs   /        ext4   defaults        0 0
/mnt/c/Users/macie/dev /home/maciek/dev        none    bind

I used sudo mount --bind -o default too.

3

1 Answer 1

2

While I am not familiar with WSL, I realized that you are missing a few options in your fstab. Also you did not specify a filesystem type. Judging from this github issue, it seems that you need to specify drvfs if you want to mount a directory from your windows installation.

Try the following:

/mnt/c/Users/macie/dev /home/maciek/dev drvfs defaults,bind 0 0

And test with mount -a then restart and check if it worked.

1
  • It works after restart after using sudo mount -a. Partial victory, but thanks for your help
    – lincoln06
    Commented Jul 23, 2022 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .