Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

fstab issue connecting Synology shared folder

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
User avatar
devNull
Posts: 18
Joined: 2022-08-25 03:26
Has thanked: 2 times

fstab issue connecting Synology shared folder

#1 Post by devNull »

I'm new to Debian. I'm running v11.4 headless on an i5 NUC.

I want to mount Synology's shared folders over the LAN to Debian. I'm able to do this with the "mount" command, but I want to make this more permanent using fstab. Unfortunately my fstab entries are not correct, as the mapped folders show no NAS shared folder content.

Here's my successful mount command:

Code: Select all

sudo mount -t cifs -o rw,vers=3.0,credentials=/root/.smbcredentials //192.168.1.42/testing /media/testing
With this command I can "see" the shared folder contents and create files via Debian. The credentials file is for a Synology administrator account.

When I adapted this to fstab, I tried:

Code: Select all

//192.168.1.42/testing /media/testing cifs rw,vers=3.0,credentials=/root/.smbcredentials 0 0
After rebooting a directory listing (ls /media/testing) is "empty". I tried this with and without the trailing zeros.

There's probably a simple thing I've overlooked here. I welcome advice.
Last edited by devNull on 2022-08-29 15:38, edited 1 time in total.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5343
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: fstab issue connecting Synology shared folder

#2 Post by dilberts_left_nut »

Probably the network is not up when mounts are processed.
Can't recall the exact terms but search for 'automount'
I think 'netdev' is obsolete.
AdrianTM wrote:There's no hacker in my grandma...

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: fstab issue connecting Synology shared folder

#3 Post by p.H »

Add "noauto" to the fstab options field and run "mount /media/testing" to check that the line is correct.
automount is just a workaround, it does not guarantee that the mount will be done only after the network is up.

User avatar
devNull
Posts: 18
Joined: 2022-08-25 03:26
Has thanked: 2 times

Re: fstab issue connecting Synology shared folder

#4 Post by devNull »

p.H wrote: 2022-08-25 09:56 Add "noauto" to the fstab options field and run "mount /media/testing" to check that the line is correct.
automount is just a workaround, it does not guarantee that the mount will be done only after the network is up.
This worked, so the fstab seems OK.
dilberts_left_nut wrote: 2022-08-25 07:01 Probably the network is not up when mounts are processed.
Can't recall the exact terms but search for 'automount'
I searched around this forum and ended up with this fstab entry that works:

Code: Select all

//192.168.1.42/testing /media/testing cifs rw,noauto,x-systemd.automount,vers=3.0,credentials=/root/.smbcredentials 0 0
If that fails later, I suppose I could add a cron job for

Code: Select all

sudo mount -a
Thanks for your help!
Last edited by devNull on 2022-08-29 15:40, edited 2 times in total.

User avatar
Bloom
df -h | grep > 90TiB
df -h | grep > 90TiB
Posts: 503
Joined: 2017-11-11 12:23
Been thanked: 26 times

Re: fstab issue connecting Synology shared folder

#5 Post by Bloom »

Not needed. Systemd will mount it automatically at the first time you use the share.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: fstab issue connecting Synology shared folder

#6 Post by p.H »

What is not needed ?

User avatar
devNull
Posts: 18
Joined: 2022-08-25 03:26
Has thanked: 2 times

Re: fstab issue connecting Synology shared folder

#7 Post by devNull »

Now that the mapping is complete... I can see the files/folders under "testing". Yet, I am unable to write to /media/testing without sudo.
I tried

Code: Select all

sudo chmod -R 777 /media/testing
but still I cannot write a file.

User avatar
devNull
Posts: 18
Joined: 2022-08-25 03:26
Has thanked: 2 times

Re: fstab issue connecting Synology shared folder

#8 Post by devNull »

Following up on my own post... I added dir_mode=0777,file_mode=0777 to the fstab entry. This seems to have resolved the write permissions (I can write/delete now). Still more testing to do here.

scythefwd
Posts: 47
Joined: 2022-03-13 23:05
Been thanked: 2 times

Re: fstab issue connecting Synology shared folder

#9 Post by scythefwd »

is this just ignoring whatever file permissions are already on the files, or is it doing something different?

User avatar
devNull
Posts: 18
Joined: 2022-08-25 03:26
Has thanked: 2 times

Re: fstab issue connecting Synology shared folder

#10 Post by devNull »

That's likely. However, the SMB credentials which are passed are insufficient from some reason. I suspect Synology's ACL implementation affects this, as Synology permissions can be vexing to sort through.

User avatar
Legion99
Posts: 16
Joined: 2021-12-08 08:33
Has thanked: 2 times
Been thanked: 2 times

Re: fstab issue connecting Synology shared folder

#11 Post by Legion99 »

A little late to this one but. I have my Synology NAS connected to my laptop and desktop. Set up to auto mount on system start.

My methodology was to enable NFS on NAS then on Linux:

sudo apt install nfs-common

Create shared folder on NAS, E.G. MyStuff
Create a target directory for mount point, and execute the following command:

sudo mount (NAS I.P.):/volume1/SharedFolder1 /Mount-point/created-above

E.G.
sudo mount 192.168.178.29:/volume1/MyStuff /media/NAS/MyStuff

Then add to FSTAB
For Desktop
192.168.178.29:/volume1/MyStuff /media/NAS/MyStuff nfs rsize=8192,wsize=8192,timeo=14,intr

Laptop
192.168.178.29:/volume1/MyStuff /media/NAS/MyStuff nfs nofail,rsize=8192,wsize=8192,timeo=14,intr

The 'nofail' is to stop the laptop looking and slowing boot time if away from local network.
The above always works for me. I can set up folders on the desktop and access NAS easily, as a local folder.
Image Deb 12 w/- Cinnamon, B550M Pro4 AM4, AMD Ryzen 7 5800X / RAM 32GB / SSD 260GB / 4TB hdd + HP ProBook 450 G1.

Post Reply