How to mount synology SMB2 share on ubuntu
I use a PI to mount a DS Share into my nextcloud instance. For that reason I use the following mounting command:
sudo mount.cifs -o username=ds-user,password=pw-of-ds-user,uid=33,gid=33,file_mode=0660,dir_mode=0770,vers=2.1 //IP-of-NAS/share /mountpoint/where/to/mount
I will explain the command
- username and password should be clear I hope
- uid gid are the values for www-date to get it working under nextcloud
file_mode
set the permission for the mounting pointdir_mode
do the same for foldersvers=2.1
that was the most important to get it working, the version 2.0 was not working for my DS in combination with my Linux- and of course the the source and destination
So you cannot copy and paste my command you must edit it to your needs, but I think the structure should be clear now.
Related videos on Youtube
wouter205
Updated on September 18, 2022Comments
-
wouter205 over 1 year
I'm having a hard time mount a SMB2 share from my synology to ubuntu server 16.04.
mount.cifs //NAMEOFNAS.domainname.local/Backup /mnt/NAS/ -U USERNAME
results in following error:
mount error(95): Operation not supported
So checking the network share with smbclient results in another error:
smbclient //NAMEOFNAS.domainname.local/Backup -U username WARNING: The "syslog" option is deprecated Enter username's password: protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE
When doing the same but with a share on Windows server, I have no problem whatsoever. Is there something I have to configure in Synology NAS (i noticed it's configured to only use SMB2)?
Here is the output of
testparm
(only thing I changed wasdomain
andsecurity=user
)# Global parameters [global] workgroup = AVR server string = %h server (Samba, Ubuntu) server role = standalone server security = USER map to guest = Bad User obey pam restrictions = Yes pam password change = Yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . unix password sync = Yes syslog = 0 log file = /var/log/samba/log.%m max log size = 1000 server max protocol = SMB2 max protocol = SMB2 protocol = SMB2 server min protocol = SMB2 min protocol = SMB2 dns proxy = No usershare allow guests = Yes panic action = /usr/share/samba/panic-action %d idmap config * : backend = tdb [printers] comment = All Printers path = /var/spool/samba create mask = 0700 printable = Yes browseable = No [print$] comment = Printer Drivers path = /var/lib/samba/printers
What can I do to mount this share please?
kr, wouter
-
ob2 about 6 yearsSome track : can you try mouting with IP address of the Synology. Also try without the FQDN (e.g. //NAMEOFNAS/Backup). I also guess that correct option for username is
-o username=username
-
wouter205 about 6 years@olivierb2 I did make a mistake in my post, I corrected the syntax of
smbclient´. When I try it with
-o username=username´ it results in the same `NT_STATUS_INVALID_NETWORK_RESPONSE´ error. Uising the NETBIOS or the IP address does not make a difference.
-
-
wouter205 about 6 yearsHi, thanks for sharing your input. I needed to change version to `vers=2.0´ in order to get it working. I'll take a look which settings for uid gid will fit me but for now it's working. Thanks!
-
wouter205 about 6 yearsSorry, I was a bit to quick. mount.cifs is working now but I need to add it to
/etc/fstab´ to mount it at boot. I added the following line
//IPADDRESSNAS/Backup/ /mnt/backup/ cifs credentials=/home/ncadmin/.smbcredentials,file_mode=0660,dir_mode=0770,vers=2.0´ but receive following error in DMESG: `CIFS VFS: Unknown vers= option specified: "2.0"´ -
WiKrIe about 6 yearsI use it for several mounts in fstab with the following syntax:
//server/share /mount/to cifs vers=2.1,credentials=/home/user/.smbcreds,uid=1001,gid=1001,iocharset=utf8,rw
I dont know why exactly but I thought vers flag must be the first one. could you please try it. -
WiKrIe about 6 yearsand now I was to quick I simple transfer my bash script into fstab from my PI and then I mount it via mount -a
//192.168.178.200/photo /mnt/remote/nas/photo cifs username=username,password=password,uid=33,gid=33,file_mode=0660,dir_mode=0770,vers=2.1
what kind of Synology did you use? I'm wondering that my synology works with 2.1 and yours with 2.0 ... -
WiKrIe about 6 yearsI have an idea, normally you would run your cron under root, and maybe your smbcred file is under user xy, so 2 options, first try to insert user and password directly into fstab, if those works create a new smbcred file under root with the account.
-
wouter205 about 6 yearsYou have good ideas :-). Indeed, with user+pw directly in fstab it worked. Now I have done
chown root:root .smbcredentials
and mounting works as a charm! Here is the line://NAMEOFNAS.domain.local/Backup/ /mnt/Backup/ cifs vers=2.0,credentials=/home/admin/.smbcredentials,file_mode=0600,dir_mode=0600
Thanks! -
Denilson Sá Maia almost 4 yearsNote: it is possible to configure Synology DSM to have Maximum SMB protocol = SMB3, which means the
vers=2.1
will not be needed anymore.