Page 1 of 2

Have NAS connect at boot via fstab

Posted: Thu Feb 27, 2020 4:23 pm
by muffybean
I have a Synology NAS that I access in Linux on my LAN. Currently I am opening the NAS by clicking on Network in file browser and selecting my NAS but with calypso (file sharing) I have to enter my username and password.
NAS alternatives..png
I have set the calypso (ftp) to remember these details and it does but the other two do not. calypso is the name of my box.

When I open them I then have access to my NAS box content.
NAS-Content..png
Now I understand that I can put a line in the fstab file that autostarts NFS but can't quite figure out along the lines of the following.

Code: Select all

//192.168.1.10/share /media/share cifs credentials=/home/user/.smbcredentials,users,rw,iocharset=utf8,sec=ntlm 0 0
but did not really understand that.

In my case the IP is 192.168.1.*** and username is p********* and the password is quite complex and that is why I want to have it start at boot.

I made a copy of my fstab file in case things went wrong and then put this line at the bottom of the fstab script

Code: Select all

192.168.1.***:/NASShare mnt/NAS nfs username=p*********,password=my-password 0 0
and saved it.

However when I booted it did not work. Can I get some advice on this please. TIA

Re: Have NAS connect at boot via fstab

Posted: Thu Feb 27, 2020 4:51 pm
by muffybean
I have now tried another way using cifs and Samba. I edited my fstab and put this at the bottom
# Samba share from my NAS box
//calypso/share mnt/samba cifs username=p*********,password=my-password 0 0
However, this did not work either.


Would really appreciate any advice on this one.

Re: Have NAS connect at boot via fstab

Posted: Thu Feb 27, 2020 7:37 pm
by AndyMH
The line in my fstab for my diskstation (216j):

Code: Select all

//diskstation.local/home/	/media/synology	cifs	credentials=/etc/samba/credentials,uid=1000,gid=1000	0	0
credentials is a simple text file of the form

Code: Select all

username=aaaa
password=xxxx
Uname and pwd are for your account on the synlogy. You can either use a credentials file (and put it where you want) as I have done, or put username=aaaa and password=xxxx directly in the line in fstab as you have done. The credentials file makes it slightly more opaque.

Note - I'm using cifs, did try nfs and failed (and still don't know why).

If problems - How have you set it up on the NAS (shared folders and file services) and what version of DSM are you running?

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 7:25 am
by muffybean
This looks good Andy, got some other work to do and witll get on to it when I finish. DSM 6.2.2-24922 Update 4, so that is the latest.
credentials is a simple text file of the form
In the

Code: Select all

credentials=/etc/samba/credentials
I take it that it as a file created called credentials.txt? Seems likely to me. Many thanks for your help. BTW I am looking for a good Password keeper and wondered if you have an opinion on Dashlane?

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 8:38 am
by muffybean

Code: Select all

/media/synology	cifs
I have come to a standstill on this part. I created a folder /media/synology but what goes in it? I do have cifs-utils installed on my system.

I ran network command

Code: Select all

sudo mount a
but got
mount error: could not resolve address for diskstation.local: Unknown error
If problems - How have you set it up on the NAS (shared folders and file services) and what version of DSM are you running?
Checked my 215j Synology settings in SMB and I am running SB1, SB2 and SB3. Apart from that not sure if there is anything else in there that I have to enable.

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 9:59 am
by AndyMH
Before we start mucking around with fstab - right click on the desktop and 'create new launcher here...'

Think you run cinnamon, so the command is nemo smb://diskstation.local
Screenshot from 2020-02-28 13-48-10.png
Screenshot from 2020-02-28 13-48-10.png (20.65 KiB) Viewed 2511 times
Click on ok. You can change the icon to something nicer later, if you want to keep it (I have both the launcher and it mounted in fstab).

Double click on it. You should get something like:
Screenshot from 2020-02-28 13-34-08.png
It will probably ask for your diskstation uname and pwd, mine doesn't because I must have clicked on save uname/pwd at some point (it was a long time ago).

The folders you see should be the same as on the diskstation > control panel > shared folders

On the diskstation control panel > file services, 'enable SMB service' is checked, the workgroup is irrelevant for linux (the entry here is different from my samba.conf file). Under 'advanced settings' I have max SMB protocol = SMB3 and min = SMB1.

If that all works then we can change your fstab.

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 10:26 am
by muffybean
Before we start mucking around with fstab - right click on the desktop and 'create new launcher here...'
I am running MATE and it is similar and right clicked desktop and and accepted the default type as Application, filled in the command line and said ok and nothing happened.

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 10:28 am
by altair4
@AndyMH

I don't think his NAS is named diskstation. According to his post it's named calypso - as in calypso.local. Then again you are the Synology expert here.

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 10:37 am
by muffybean
altair4 wrote: Fri Feb 28, 2020 10:28 am @AndyMH

I don't think his NAS is named diskstation. According to his post it's named calypso - as in calypso.local. Then again you are the Synology expert here.
Yes you are correct altair it is named calypso
calypso..png
calypso..png (7.88 KiB) Viewed 2488 times

However, whether I try create a launcher using Diskstation or calypso as here
Launcher..png
when I click ok nothing happens and screen disappears.

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 10:39 am
by altair4
Then change diskstation.local to calypso.local in your launcher.

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 10:50 am
by muffybean
altair4 wrote: Fri Feb 28, 2020 10:39 am Then change diskstation.local to calypso.local in your launcher.
What about the nemo smb:// bit?

Just tried again
calypso-launcher..png
calypso-launcher..png (26.75 KiB) Viewed 2466 times
and as soon as I click ok nothing happens a the launch create disappears

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 11:03 am
by altair4
I'm getting very confused.

You say you are using MATE. Do you have nemo installed on MATE or do you use caja as your file manager?

If you are using Caja then in the launcher you want: caja smb://calypso.local

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 11:11 am
by muffybean
altair4 wrote: Fri Feb 28, 2020 11:03 am I'm getting very confused.

You say you are using MATE. Do you have nemo installed on MATE or do you use caja as your file manager?

If you are using Caja then in the launcher you want: caja smb://calypso.local
Yep that was it, not used to these different file manager types yet as I just think of them a file browsers and click on the relevant icon in the panel. Actually I am now using one called Krusader that I find much more useful. Now have to await Andy's further instructions.

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 11:54 am
by muffybean
Right getting a bit closer. I have modified the fstab file as follows at the bottom as
//calypso.local/home/ /media/synology cifs credentials=/etc/samba/credentials,uid=1000,gid=1000 0 0
and with the other changes regarding launcher and different paths something is happening.

When I boot up I have a folder mounted called Synology on my desktop, which is in media/synology.
NAS result..png
Now the content of that is my home folder on my NAS box as shown here.
calypso-home-folder.png
whereas I am looking to access all those folders on the left. Is this anything to do with with the setup in the 215j files station?

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 1:13 pm
by muffybean
Right I am understanding this command in the fstab line. I changed it from home to Data

Code: Select all

//calypso.local/Data/	/media/synology	cifs	credentials=/etc/samba/credentials,uid=1000,gid=1000	0	0
and that opened a more meaningful folder. However, Apart from adding all the folders line by line is it not possible to open all of them as you have in yours Andy?

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 1:47 pm
by AndyMH
Did you change anything or did the synology come with 'calypso.local' out of the box instead of 'diskstation.local'?

In your fstab, instead of //calypso.local/Data/ try //calypso.local, it should give you the folders as shown in your diskstation screenshot in your previous. An alternative could be //calypso.local/homes which might show you everything.

I'll remember for next time, you're using mate not cinnamon.

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 3:12 pm
by muffybean
Did you change anything or did the synology come with 'calypso.local' out of the box instead of 'diskstation.local'?
Yes I changed to Calypso a beloved dog we had who sadly rests just outside our back door much missed.

I had successfully done the Data which worked just for that folder. When use just local without any extension, I get this
Data-line..png
When I get homes, that just gives me all my user accounts. I even tried using the IP of the box, 192.168.1.218 but that to fails to work. Just can't figure out how to have the whole box on view as it does when
I go via network in caja where I insert username and password and all the folders are on view.

Couple of minor points, how do you create the rectangle box area to enclose your paths. Plus is that flag the county flag of Wiltshire?

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 3:20 pm
by muffybean
Looking at my NAS I wondered if I can create anything in the tools/mount a remote folder in File Station.
Mount-remote.png

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 3:39 pm
by AndyMH
192.168.1.218 is no different to calypso.local, just using mdns (called avahi in linux - installed by default, bonjour on a mac).
I go via network in caja where I insert username and password and all the folders are on view.
What is caja showing as the address at the top of the window when you do that?
Do you get any options to save uname/pwd so you don't have to do it every time?
Couple of minor points, how do you create the rectangle box area to enclose your paths. Plus is that flag the county flag of Wiltshire?
It's the c button above the replay window, and yes, Wiltshire, not a very exciting flag is it?

Calypso, likewise except it was Bertie, nearly fifteen. Now we have another lab and he's just about to reach his first birthday (and I'd forgotten how much hard work puppies are).

Re: Have NAS connect at boot via fstab

Posted: Fri Feb 28, 2020 3:49 pm
by muffybean
First of all getting back to the launcher thing, when I create caja smb://calypso.local and click that the and then enter username and password in there all of the folders open as here. Also, you can see the path on top.
launcher+fstab..png
As you see the Synology mount has opened via fstab but that is just the data folder, which is my most used one.

Is there any way to put that launcher thing into fstab? Be back in around 20 minutes as I am finishing the washing up! :roll: