Trying to setup a synology NAS but struggle to get it mounted

Having used OpenSuse for well over a decade, but never did any network management and now have to admit defeat, I am completely stuck… I am by no means familiar with things like Samba, NFS and so on, it becomes a bit daunting at the moment.

After a major harddrive failure I decided to buy an NAS (Synology DS218+) and run it in raid 1 mode. I got it running practically out of the box in Windows, but have failed so far to access it in Leap 15.1 (have not tried other versions or distro’s). I can access it via a webbrowser, but obviously I want to have it mounted and directly accessible.

I tried mounting it using the following command:
sudo mount -t cifs -o vers=2.0,user=<myname>,password=<*****> //<IP ADDRESS>/volume1/homes/<myname> /home/NAS/

Which returns the following error:
*mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
*
I found several reports online of people with the same type of errors returned, where they were able to solve it by changing the version number to “one”. Unfortunately, that did not solve the problem for me, it returns the exact same error.

Just to be sure, I checked whether I could find the NAS using:
sudo arp-scan <IP ADDRESS>
which returned a message that the Synology NAS is found on the specified IP address.

This morning I tried to edit my fstab file, adding the NAS adress and mount point manually, but it resulted in my system being unbootable. I managed to reset the fstab file to the original settings using a Leap live stick, so it booted again. But I became a little hesitant to interfere with stuff that I am not familiar with…

Anyone that can explain this noob how to get this working?

Thanks,
Rogier

As it says “*No such file or directory” *the question is of course:does /home/NAS exist or not?

Try using the YaST module

https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.samba.html#sec.samba.client.inst

TSU

rogier@linux-85ac:/home> ls
rogier Zhegedongxi_NAS

The folder to where I want to mount the NAS does exist.

Please use Code-Tags (the small #) for any output from an terminal.
And please post all from terminal incl. the complete input-command.
Use copy paste.

PS:

ls -al /home 

is better to show more parameter…

That is NOT what I see in your post. According to your mount statment in post #1

mount -t  cifs -o vers=2.0,user=<myname>,password=<*******> //<IP  ADDRESS>/volume1/homes/<myname> /home/NAS/

there should exist

/home/NAS

and it should be a directory.

You are right, unfortunately it did not resolve the issue…

Full output of the home folder:

rogier@linux-85ac:/home> ls -al
total 4
drwxr-xr-x  4 root   root    43 Sep 24 20:28 **.**
drwxr-xr-x  1 root   root   182 Sep 24 20:07 **..**
drwxr-xr-x 21 rogier users 4096 Sep 24 20:06 **rogier**
drwxr-xr-x  2 rogier root     6 Sep 24 20:28 **Zhegedongxi_NAS**

With the updated mount command using the corrected mounting point

rogier@linux-85ac:/home> sudo mount -t cifs -o user=Rogier,password=<******> //<IP ADDRESS>/volume1/homes/Rogier /home/Zhegedongxi_NAS/
[sudo] password for root:  
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

In that case, shouldn’t it be written /home/rogierZhegedonxi_NAS​and not /home/NAS?

NOTE: Just realized someone else caught that.

I am not sure about this, but I would never use a / as the last character of the mount point. Thus I would perefer /home/
Zhegedongxi_NAS.

Off topic.
Are you sure you want root as the owning group for this directory/mount point where rogier is the owner?
It could be you have a particular reason for it, but when not, I would prefer users (like rogier’s home directory).

There indeed was a mistake spotted by HCVV in the initial mount command, where I used just “NAS” instead of the Zhegedongxi_NAS, which was the folder name. Unfortunately, that resulted in the same error.

As for the group rights of Zheregdongxi_NAS, there was no particular reason for it to be part of root. I had to create the folder as root, modified the ownership to myself but didn’t change the group ownership. Good point, changed it

rogier@linux-85ac:/home> ls -all
total 4
drwxr-xr-x  4 root   root    43 Sep 24 20:28 **.**
drwxr-xr-x  1 root   root   182 Sep 24 20:07 **..**
drwxr-xr-x 21 rogier users 4096 Sep 24 20:06 **rogier**
drwxr-xr-x  2 rogier users    6 Sep 24 20:28 **Zhegedongxi_NAS**

Omitting the final “/” in the mountpoint unfortunately also didn’t do the trick:

rogier@linux-85ac:/home> sudo mount -t cifs -o user=Rogier,password=<******> //<IP ADDRESS>/volume1/homes/Rogier /home/Zhegedongxi_NAS
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

@Rogier:

Looking at the specification of the Synology DS218+:

  • Hardware Specs:

File System: Internal Drives:

*=2]Btrfs
*=2]EXT4

Therefore, it’s a Linux box with a Btrfs and EXT4 partitions on the disk(s) …

  • Software Specs:

File Services: File Protocol: CIFS/AFP/NFS/FTP/WebDAV

Therefore, on the NAS, setup to use the NFS Server on the box to export the directories you wish share via NFS.

On your Linux box, setup to auto-mount those NAS directories as an NFS Client …

Why not 这个东西_NAS ??? lol!

I strongly support @dcurtisfra.

Why using a MS Windows oriented solution (with all problems about ownership and permisions that come with it) when the box supports NFS?

This is where I am treading unknown territories. I had already created an “NFS rule” (??) on the NAS webinterface. I have assigned the IP address of my laptop to have read/write access, squash set as “no mapping” and allowed “asynchronous” for the folders in “volume1/homes”. But this I have done several days ago already, but very well may be completely wrong.

@HCCV:

Why not 这个东西_NAS ???

Hahaha, really silly actually. I cannot write and/or read Mandarin, but I can get around a bit verbally.

Another way to mount external network drives is using autofs. It’s a very nice way to only mount a device when you need it, mounting is done when you want to make contact with the drive. For example if you click the name of the drive in the file-manager, the connection is made and the data is available. After a time-out, which you can set up yourself the connection is gone again. During boot, when the drive is not connected or switched off, you see no long waiting period, the drive is not mounted during boot, but only when you approach it.

At the moment I still use Manjaro Linux and have this setup, but I plan to start using OpenSuse after my holiday. On the Manjaro wiki pages I created this page: https://wiki.manjaro.org/index.php?title=Using_autofs_(automount)_with_NFS
It could be that on OpenSuse you need to install some extra packages, I can not tell you this right now cause I don’t use it yet. Maybe somebody else knows this.

The give a recap of the wiki page, which contains too much info, this is what needs to be done:
install autofs
Probably in the folder /etc/autofs but this could also be in /etc (this differs per Linux distro) you need to files: auto.master and auto.something (extension can be chosen freely)
In auto.master you write one line: (example)
**/mnt /etc/autofs/auto.shares --time-out=5 --ghost

**
In the second file (/etc/autofs/auto.shares) you type this:(example)
**NAS-Synology -fstype=nfs,rw,soft,retry=0 Synology:/nfs/Public **(this last part can be different, look for info in the Synology docs)

The name of the second file has to match the entry in the master file, cause it links to it.

Enable autofs with:
**sudo systemctl enable autofs
**
Then start it with:
**sudo systemctl start autofs
**
When all your settings are correct, you will now see the contents of your NAS in the folder /mnt.

Success.

OK. Then, let’s begin with some basics:

  1. AFAICS, despite the usage of Linux on their NAS boxes, Synology, QNAP & Co. tend to be heavily Microsoft and Apple oriented – understandably, because of market share …
  2. If Microsoft or Apple network protocols then, GUI (KDE or GNOME) File Manager access (Dolphin / Files) with the NAS credentials stored in a the appropriate Password Manager (KWallet or Keyring) is IMHO the most reliable method for these protocols (CIFS and AFP).
  3. For the case of Linux (UNIX®) “pure” then, NFS with the clients auto-mounting is, IMHO, the way to go – caveat: my QNAP NAS box is currently misbehaving as far as NFS is concerned
    … 1. Yes, it is possible to perform a CIFS auto-mount but, it’s really only needed for scripts to manipulate files between the Linux system and the NAS.
  4. Check if your NAS box supports the “rsync daemon”.

[HR][/HR]Think about why the NAS box has been purchased – the usual Use Case is to archive files – therefore “rsync” …

  • “rsync to an rsync daemon” uses TCP (usually port 873).
  • “rsync via SSH” will possibly not work with a typical NSA box because, at least for the QNAP case, SSH is “only for admin” …

I think the subject of automounting is a bit off-topic here because in the first place the OP must be able to mount it NAS NFS exports at all. After that succeeds he may contemplate if autmounting them in day to day runinng is a good idea.

And why we are at it. look at systemd.automount

man systemd.automount

It allows you to configure autmounting just in /etc/fstab. Even easier then the “old” auotomount.

+1 from me.

A useful reference (applicable to openSUSE as well)…
https://wiki.archlinux.org/index.php/fstab#Automount_with_systemd

Allright, that starts to clarify things a bit more to me, although the technicalities of course are still a mystery to me. Opening YAST and starting to setup a NFS client results me in guessing most of the fields. But nonetheless, it seems I made a big step forwards with all of your help. Magically, an entry appeared in the FSTAB file, which causes me to see the NAS in Dolphin under remote. It mounts, but is only accessible as root. I could only access it through the terminal with sudo commands, but creating a small text file on the NAS indeed resulted in a text file that I could see in the webinterface of the NAS. Great, this really is a huge step forward, the only thing that would be necessary is to remove the need being root to access it.

the FSTAB row that was “magically” added:

<IP ADDRESS>:/volume1/homes               /home/Zhegedongxi_NAS   nfs    nfsvers=3                     0  0

Maybe a silly question, but should “nfs” in this row actually be btrfs? At least, I can see other rows having btrfs where the disks are formatted as btrfs, as is the NAS?

Once this is all running fine, indeed the final step will be to automount it, but I’ll save that till last. I have the impression this will happen already anyway since it is in the FSTAB file (but correct me if I am wrong).

Many thanks so far all!