#Debian on Pi mount NAS SMB on Boot failing - SOLVED

1 messages · Page 1 of 1 (latest)

tall spoke
#

Need guru help to solve this. New to linux and really can't grasp the way users and groups work.

Using a Pi400 with the Raspberry Debian OS.

I have a NAS with SMB shared folders that I access from the Pi.

After boot, I manually run a bash script ( using a shortcut on the desktop ) that executes :

sudo mount.cifs //192.168.x.xxx/GailOnlinBackup /home/gail/NASdrive -o credentials=/home/gail/.smbcreds,noperm

This works perfectly. Connects to the NAS, mounts the folder and adds a desktop icon for the SMB Folder. I can open the folder and access the files.

Now I want to have the mount run at boot ( instead of having to start with the desktop icon )

used Terminal, changed to the etc folder, and then sudo nano fstab

line added to fstab file :
192.168.x.xxx/GailOnlinBackup /home/gail/NASdrive cifs vers=3.0,credentials=/home/gail/.smbcreds

This is where I get stuck. On reboot, the NASdrive appears in the list of drives in the File Manager, but I can't see the files in the folder - Permission Denied.

the error it throws is : mount:cifs Permission Denied

also tried changing the fstab code to this, but same result :
//192.168.x.xxx/GailOnlinBackup /home/gail/NASdrive cifs vers=3.0,credentials=/home/gail/.smbcreds,iocharset=utf8,gid=0,uid=0,file_mode=0777,dir_mode=0777 0 0

Only if I use Terminal and run : sudo mount -a
then I can access the folders and see the files

So it appears that the line in fstab connects and lists the SMB shared folder, but does not mount it until I run sudo mount -a

tall spoke
#

update : partially solved.

After a long search, I can across info that indicates the fstab on the pi is run before the network connection is established, so I guess the drive is added, but not mounted / populated as there is no network connection at the time the fstab file executes.

Changed the fstab line to :

//192.168.x.xxx/GailOnlinBackup/ /home/gail/NASdrive cifs _netdev,uid=gail,gid=gail,credentials=/home/gail/.smbcreds,x-systemd.automount 0 0

Now it connects and mounts the drive.

Only issue is that it adds 2 icons to the desktop - 1 appears to be a Drive icon, and the other a Cloud Folder icon. Selecting either icon opens the File Manager at the Cloud Folder location ( /home/gail/NASdrive )

Is there a way to have only 1 icon added to the desktop by the fstab script ?

tall spoke
#

fixed by adding : ,x-gvfs-hide to the fstab line