tarads
Posts: 10
Joined: Wed Jun 03, 2015 4:48 am

Raspberry Pi and a Synology NAS

Wed Jun 03, 2015 5:01 am

I'm new to the raspberry pi (and linux in general) and for the life of me can not figure out what I'm doing wrong here. Basically... I have a raspberry pi running Deluge. It works perfectly and I was able to get it running following a How-To-Geek blog post.

The issue is that I have no idea how to get my raspberry pi to communicate with my Synology NAS.

A bit of background, I have a program on my NAS that searches for files to download, sends the torrent file to Deluge and then moves said file to its appropriate folder once the download is complete. The NAS program is sending files to the Pi just fine, but the Pi isn't seeing the NAS. Before setting up my raspberry pi I had Deluge running on windows and was able to point to the NAS using //NAS/Data/Folder, but that no longer works on the Pi.

I've tried googling and following this: https://alextheedom.wordpress.com/raspb ... nas-drive/

But that only gets me an error at the "mount –a" step. Thoughts on what I'm doing wrong?

myoung008
Posts: 55
Joined: Mon Mar 18, 2013 9:56 pm

Re: Raspberry Pi and a Synology NAS

Wed Jun 03, 2015 7:22 am

There is an error in your /etc/fstab. fstab is just a text file, when you "mount -a" it tries to mount everything in there.

The first field in the line is the UNC path to your NAS share, only with forward slashes instead of backslashes. In your case: //NAS/Data/Folder

The second field is the local mount directory. This directory must exist locally.

fstab entries are one line only, make sure you didn't add the last half as a second line.

There is a space after "cifs" where the blog wraps the line.

Make sure you didn't add spaces in the option list between workgroup and xattr.

If the share is password protected you will have to add username / password options.

tarads
Posts: 10
Joined: Wed Jun 03, 2015 4:48 am

Re: Raspberry Pi and a Synology NAS

Wed Jun 03, 2015 2:55 pm

Thanks for the reply.

First, I forgot to post the error that I'm getting. It is:

Code: Select all

Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
I've tried putting in exactly what the linked webpage says, and had that error. After googling I found someone say to the line that is below. I have that exactly (though with the correct username/password):

//192.168.1.5/NAS-Home /home/pi/myNAS/myShare cifs workgroup=WORKGROUP,username=user,password=password 0 0

It is all posted on one line.

Am I missing something?

myoung008
Posts: 55
Joined: Mon Mar 18, 2013 9:56 pm

Re: Raspberry Pi and a Synology NAS

Wed Jun 03, 2015 6:42 pm

That error is telling you it can't find the network share, either the host or the sharename. Most likely there is a problem with the UNC path. Check that capitalization matches what's on your NAS exactly. I don't think that the dash in the share name would cause a problem, but just in case, try enclosing the path in a single quote. Also, if you've changed the workgroup on the NAS you will need to change the workgroup option to match.

Code: Select all

'//192.168.1.5/NAS-Home' /home/pi/myNAS/myShare cifs workgroup=MYACTUALWORKGROUP,username=user,password=password 0 0

tarads
Posts: 10
Joined: Wed Jun 03, 2015 4:48 am

Re: Raspberry Pi and a Synology NAS

Wed Jun 03, 2015 7:13 pm

Thanks for the reply.

I double checked on the NAS and the workgroup name is still WORKGROUP. So all good there. I attempted to add the single quote and now am getting this error:

Code: Select all

mount.cifs: bad UNC ('//192.168.1.5/NAS-Home')

myoung008
Posts: 55
Joined: Mon Mar 18, 2013 9:56 pm

Re: Raspberry Pi and a Synology NAS

Wed Jun 03, 2015 7:23 pm

The single quotes obviously won't work then, they can work on the command line but apparently not in fstab.

Try the following:

Code: Select all

smbclient -L 192.168.1.5 -U username
Replacing username for the correct username of course. It may help you figure out what path you need. You can post it's output and I'll try to help further if the answer doesn't jump out at you.

tarads
Posts: 10
Joined: Wed Jun 03, 2015 4:48 am

Re: Raspberry Pi and a Synology NAS

Tue Jun 09, 2015 2:45 am

Sorry about the delay in getting back to you, things got busy and I kept putting it off. Here is the result:

Code: Select all

Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.16]

        Sharename       Type      Comment
        ---------       ----      -------
        NAS Home       Disk
        web             Disk      System default shared folder
        IPC$            IPC       IPC Service ()
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.16]

        Server               Comment
        ---------            -------
        NAS-HOME
        LIVINGROOM-PLEX      OpenELEC

        Workgroup            Master
        ---------            -------
        WORKGROUP            LIVINGROOM-PLEX

I've tried using NASHOME, NAS-HOME, NAS Home, and every other combo I can think of, still nothing.

myoung008
Posts: 55
Joined: Mon Mar 18, 2013 9:56 pm

Re: Raspberry Pi and a Synology NAS

Tue Jun 09, 2015 3:21 am

You may get away with using \040 (zeroes) in place of the space in fstab.

Code: Select all

//192.168.1.5/NAS\040Home /home/pi/myNAS/myShare cifs workgroup=MYACTUALWORKGROUP,username=user,password=password 0 0
I just searched and found that as I've always avoided spaces in sharenames before. I have also seen a reference that it doesn't work in some situations (though it wasn't specific). If it doesn't work for you my suggestion is to change the sharename on the NAS to avoid the space.

Hope this helps.

tarads
Posts: 10
Joined: Wed Jun 03, 2015 4:48 am

Re: Raspberry Pi and a Synology NAS

Tue Jun 09, 2015 6:31 am

Thanks, I'll give this a shot tomorrow!

tarads
Posts: 10
Joined: Wed Jun 03, 2015 4:48 am

Re: Raspberry Pi and a Synology NAS

Fri Jun 12, 2015 6:40 pm

Just wanted to come back and say thanks! Sure enough the error was being caused by that stupid space in the name. Changed that and sure enough everything worked like a charm. Go figure!

Thanks again, you were a huge help!!!

myoung008
Posts: 55
Joined: Mon Mar 18, 2013 9:56 pm

Re: Raspberry Pi and a Synology NAS

Fri Jun 12, 2015 9:26 pm

Excellent! Glad I could help.

tarads
Posts: 10
Joined: Wed Jun 03, 2015 4:48 am

Re: Raspberry Pi and a Synology NAS

Sun Jun 14, 2015 4:26 am

So... weird related issue that maybe you can (again) help me with.

After putting the line in /etc/fstab, I can then "mount -a" and the NAS is mounted and works great. The problem is that after a reboot the NAS isn't mounted. If I manually type out "mount -a" everything works again, but continues to go away after a reboot.

The line I ended up suing in fstab is this:

Code: Select all

//192.168.1.5/NASHome /home/pi/myNAS cifs workgroup=WORKGROUP,username=admin,password=password,users,auto,user_xattr 0 0
Thoughts?

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Pi and a Synology NAS

Sun Jun 14, 2015 10:17 am

Does your NAS support using NFS rather than CIFS?

If it does you'll find it's a) quicker, b) easier to manage and c) works with the Linux security model (no passwords in fstab).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: Raspberry Pi and a Synology NAS

Sun Jun 14, 2015 12:23 pm

Synology NASs do have NFS support. It can be enabled from Control Panel, File Sharing, File Services.

tarads
Posts: 10
Joined: Wed Jun 03, 2015 4:48 am

Re: Raspberry Pi and a Synology NAS

Sun Jun 14, 2015 5:35 pm

Thanks for the replies. Im not at home but will enable NFS later today.

Can you link or explain how to auto mount the nas via NFS?

Thanks!

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Pi and a Synology NAS

Sun Jun 14, 2015 5:41 pm

sudo nano /etc/fstab and add a line like

Code: Select all

192.168.xxx.nnn:/dir/subdir/nfs/server /srv nfs defaults 0 0
with appropriate values for the IP address and the NFS share.

You can find NFS shares with a showmount command
pi@apollo:/var/log$ showmount -e 192.168.xxx.nnn

Code: Select all

Export list for 192.168.xxx.nnn:
/dir/subdir/nfs/home           192.168.xxx.0/24
/dir/subdir/nfs/server         192.168.xxx.0/24
/dir/subdir/nfs/shared         192.168.xxx.0/24
pi@apollo:/var/log$
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

tarads
Posts: 10
Joined: Wed Jun 03, 2015 4:48 am

Re: Raspberry Pi and a Synology NAS

Mon Jun 15, 2015 12:29 am

Managed to get it mounted via NFS. But still having the same issue of it not being mounted after a reboot. I have to manually go and "mount -a" before the NAS will show up. Thoughts??

tarads
Posts: 10
Joined: Wed Jun 03, 2015 4:48 am

Re: Raspberry Pi and a Synology NAS

Tue Jun 16, 2015 4:02 pm

Bump? Anyone?

morgad
Posts: 21
Joined: Sun Jan 29, 2012 10:24 pm
Contact: Website

Re: Raspberry Pi and a Synology NAS

Tue Jun 16, 2015 4:52 pm

viewtopic.php?f=63&t=111822&p=766995&hi ... nt#p766995

does this help?

best regards
Dave
(still stuck with stupid uid numbers when he tries to nfs mount his Synology box :cry: )

Return to “Troubleshooting”