pgermain
Posts: 1
Joined: Sun Aug 02, 2020 5:24 pm

Can't mount Synology NAS to Pi 4

Sun Aug 02, 2020 7:39 pm

I recently purchased a Pi4, which is attached to a switch on my network (which is in turn attached to the Gateway unit of my Eero 3-pack - which works great, incidentally).

The Pi 4 has full internet access and has been assigned a static IP. It has been set up as a pi-hole, and is working well.

I have a Synology DS220j NAS attached to the same switch. The DS220j is recognized as a network drive by 4 Windows computers (one attached to the same switch, the others by wifi to the Eero mesh). Each computer can copy and move files to and from the NAS.

My problem is, I have not been able to mount the NAS as a network drive on the Pi4. I have tried several internet tutorials (usually through SSH commands), but nothing seems to work.

I even tried this tutorial from Synology:

https://www.synology.com/en-us/knowledg ... etwork_NFS

As part of this procedure, I have the DS220j set for NFS permissions.

I CAN go through the steps to mount the drive (>network>mount in the file explorer), and SEE the NAS on my Pi4 (though each time I reboot the Pi4, I have to remount the network drive). I can navigate around the drive, finding folders and files - but I cannot seem to transfer (move or copy) files from the Pi4 to the DS220j, or vice versa. I keep getting "permission denied" error messages.

Hoping to start over, I've tried to unmount the drive, using the "sudo umount -a" command in SSH, but I get this reply:

umount: /run/user/1000: target is busy.
umount: /run/user/999: target is busy.
umount: /var/log: target is busy.
umount: /sys/fs/cgroup/unified: target is busy.
umount: /sys/fs/cgroup: target is busy.
umount: /run: target is busy.
umount: /dev/shm: target is busy.
umount: /dev: target is busy.
umount: /: target is busy.

I've been working with windows computers for years, but I'm a complete novice with both the Pi4 and Linux in general, so I'm assuming the problem is due to my ignorance.

I should mention that I AM able to quickconnect to the NAS via the web browser on my Pi4, and have successfully uploaded files from the Pi4 to the NAS, and downloaded files from the NAS to the Pi4. But I can't seem to mount the NAS as a network drive on the Pi4.

Pgermain

Sgt_jamez
Posts: 5
Joined: Thu Jul 30, 2020 6:26 pm

Re: Can't mount Synology NAS to Pi 4

Mon Aug 03, 2020 3:09 am

Ok, so this is one I can actually answer. I use my Synology NAS with my rPi4 daily.

1) Use SMB shares
2) Create a user on the NAS with the appropriate permissions to access the share
3) On the Pi you need to create a mount point under the /mnt folder. Example:
$ sudo mkdir /mnt/fileserver
4) Create a hidden credentials file and add the username and password from step 2. Example:
$ sudo nano .smb_cred_pi
Add the text:
username=NASusername
password=NASuserpwd

Now make it read/write:
chmod 600 .smb_cred_pi

7) Edit fstab with the following text:
#Network Share
//192.168.x.x/<NASsharename> /mnt/fileserver cifs credentials=/home/<pi_user>/.smb_cred_pi,rw,uid=1000,gid=1000,nounix,vers=1.0,iocharset=utf8,file_mode=0770,dir_mode=0770,noauto,x-systemd.automount 0 0

8) I don't know exactly what this does but the guy who helped me said to run this to make the gods happy
$ sudo systemctl daemon-reload && systemctl restart remote-fs.target

9) You may need to reboot but the commands above *should* have taken care of that. If all goes well, looking inside the /mnt folder in this example you should find a folder named fileserver. Opening that, you should see the contents of the share on your Synology box. Bookmark the fileserver folder and it will be there waiting for you when you need it.

Let me know how it goes. Good luck!

-Sgt Jamez

DarrenHill
Posts: 265
Joined: Fri Oct 03, 2014 3:03 pm

Re: Can't mount Synology NAS to Pi 4

Mon Aug 03, 2020 1:34 pm

If you're using NFS - what did you set on the Synology for the squash item in the folder sharing set-up?

The simplest is normally to set it to map root to admin. It sounds like you may have a permissions mismatch between the devices which isn't allowing the file transfer, but is allowing the browsing.

As you note the mounts don't survive a reboot, but you can have them automatically set up again using FStab as described above (although the exact settings will be different for NFS than the one there, as that's for SMB).

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

Re: Can't mount Synology NAS to Pi 4

Mon Aug 03, 2020 7:57 pm

DarrenHill wrote:
Mon Aug 03, 2020 1:34 pm
If you're using NFS - what did you set on the Synology for the squash item in the folder sharing set-up?

The simplest is normally to set it to map root to admin. It sounds like you may have a permissions mismatch between the devices which isn't allowing the file transfer, but is allowing the browsing.

As you note the mounts don't survive a reboot, but you can have them automatically set up again using FStab as described above (although the exact settings will be different for NFS than the one there, as that's for SMB).
Er, the OP appears to be trying to use CIFS/Samba.

They should use NFS when the client is a Linux machine and then your comments may be relevant.
Criticising any questions is banned on this forum.

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

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

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

Re: Can't mount Synology NAS to Pi 4

Mon Aug 03, 2020 11:50 pm

DougieLawson wrote:
Mon Aug 03, 2020 7:57 pm
DarrenHill wrote:
Mon Aug 03, 2020 1:34 pm
If you're using NFS - what did you set on the Synology for the squash item in the folder sharing set-up?

The simplest is normally to set it to map root to admin. It sounds like you may have a permissions mismatch between the devices which isn't allowing the file transfer, but is allowing the browsing.

As you note the mounts don't survive a reboot, but you can have them automatically set up again using FStab as described above (although the exact settings will be different for NFS than the one there, as that's for SMB).
Er, the OP appears to be trying to use CIFS/Samba.

They should use NFS when the client is a Linux machine and then your comments may be relevant.
Dougie

Didn't you read and understand this part of the opening post:

"I even tried this tutorial from Synology:

https://www.synology.com/en-us/knowledg ... etwork_NFS

As part of this procedure, I have the DS220j set for NFS permissions."

Furthermore the client is a Linux machine - did you miss the mention of "Pi4" and all those occurrences of "umount"?
Quis custodiet ipsos custodes?

Return to “Networking and servers”