Solution: having to mount shared folder at every reboot

Hi guys,

I was having a problem the last weeks with a mounted windows shared folder on pop os. Every reboot I had to

sudo mount -a

to remount the folder and now I’ve found the solution. So if any of you face the same challenge you know what to look for.

Here’s the outline of what I did:

On W10

  • Created new user and password
  • Shared folder to that new user

On Pop OS

  • Installed samba
  • Created a directory to mount the shared folder
  • Edited the nsswitch.conf to include WINS in the hosts
  • Created a file with the user and password called “.smbcred”
  • Edited the fstab to include the windows shared folder path with the samba credentials

The way I did the last step was the reason I had to mount the folder on every reboot. Instead of using the IP path, I used the windows network path.

So instead of using //192.168.10.2/sharedfolder I was using \\DESKTOP-xxxxx\sharedfolder on the fstab file. Changed this and now it’s working.

And many thanks to the author of this article who wrote

“Try to use the IP address of the remote computer instead of its name to access the folder.”

1 Like

That’s interesting, I wouldn’t expect a difference. I always just have x-systemd.automount 0 0 and they always work, no matter what

As a sample

//NAS02.mydomain.com/Media /media/PLEX cifs rw,credentials=/media/Credentials/.plexsmbcreds,uid=1000,gid=1000,file_mode=0660,dir_mode=0770,vers=3.0,iocharset=utf8,x-systemd.automount 0 0

2 Likes

I’m not using the x-systemd.automount 0 0. Mine is:

//192.168.1.20/sharedfolder /media cifs credentials=/home/user/.smbcred,iocharset=utf8,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0

Now I know and I’ll try the automount this week with the windows path to see if it works. Thanks for the tip

I will say this, I am no linux expert so take that for what it is. Once many, many years ago I used a config just like that and it’s always worked, so I’ve never even looked to see if it was still the preferred way

One of the exciting features I have found using Linux is there are always multiple ways of configuring Linux when usually there is only one way to configure Windows.

Just tried the network path and the automount flag. It works too!