mounting NAS-folder

Hi there,
I try to mount a NAS-folder by this in etc/fstab:

//192.168.178.28/backupCK    /mnt/NASbackup        nfs    username=userCK,password=blablabla,users 0 0

But in Dolphin I get this message:
Beim Zugriff auf „backupCK:/mnt/NASbackup auf 192.168.178.28“ ist ein Fehler aufgetreten, die Meldung lautet: mount.nfs: remote share not in 'host:dir' format

When I edit the : to the etc-fstab-file like this:

//192.168.178.28:/backupCK    /mnt/NASbackup        nfs    username=userCK,password=blablabla,users 0 0

I get this message in Dolphin:
Beim Zugriff auf „Arbeitsfläche“ ist ein Fehler aufgetreten, die Meldung lautet: mount.nfs: Failed to resolve server //192.168.178.28: Name or service not known

Can anybody help?

This looks like a Samba/SMB share. But you are using NFS as a file system. Which one is it?

https://wiki.archlinux.org/index.php/NFS#Mount_using_/etc/fstab
https://wiki.archlinux.org/index.php/Samba#As_mount_entry

First it was on smbfs.
But then I got this message:
Beim Zugriff auf „backupCK:/mnt/NASbackup auf 192.168.178.28“ ist ein Fehler aufgetreten, die Meldung lautet: mount: /mnt/NASbackup: unbekannter Dateisystemtyp »smbfs«.
So I thought, that my NAS has no SMB support, or manjaro does not have it, so I changed to nfs.

This is not the correct keyword to put in the fstab file system column. Please check the Arch Wiki on Samba/SMB.

https://wiki.archlinux.org/index.php/Samba#As_mount_entry

Also you should really consider using systemd mount, it is often easier to write.

Hi,

I've read your articles. Two questions:

Do I have to first create a *.mount file an after this the *.automount, or is it possible to only create a *.automount?

If this is possible, how must the *.automount be configured, to let the system know the path to my NAS?

You need both - the automount is used when the mount may not yet exist e.g. a network share.

The automount depends on the folder created by the mount unit - so a mount unit must be manually started and stopped at least once before enabling and starting the automount.

Yippieeeeeeeeeeeeeeeeeeeeee,

it works.

files stored in mountpoint now landing on my NAS. Perfect. Thanks for your help.

But now comes the next problem:
I tried to backup with Grsync.
The following message came back:

rsync -r -t -p -o -g -v --progress --delete -s /home/ck/Schreibtisch /mnt/NASbackup

sending incremental file list
rsync: [generator] chgrp "/mnt/NASbackup/Schreibtisch" failed: Operation not permitted (1)

What do I have to change in the NAS or in Grsync?

I usually recommend to use a structure which you can change permission on - such as /data/nas - my favorite :slight_smile:

If it is a smb share then you will probably need file_mode and dir_mode set to 0777.

This is because the initial mount by systemd is done as root and then you don't have permissions to write - unless you set it.

It is a nfs share.

the message comes everytime I try to save files to the NAS, but the files have been saved.
:thinking:
Is it possible to ignore the message? Or will something happen, what I do not want to?

This means it was not possible to change the group of the folder /mnt/NASbackup/Schreibtisch because you don't have the right to do it.

which consequence does that have?
Or do I have to change the rsync command?

Depending on your actual export of the share and the version of nfs and the nas user/group permission used you may need to map the files to root to be able write without error messages.

Example for a nfs share on a synology nas

/volume1/data	192.168.10.20(rw,sync,no_wdelay,insecure,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)

If you have no_root_squash then your access will depend on the permissions on the mountpoint and if the actual user id connecting matches the uid and gid on the share - which is not what you want.

thanks by now.
But this is above my actual knowledge.
It will take some time to answer.
I do not understand enough to even ask a question. :grinning:

I would check the rsync command to see if one of the options is the one which want's to alter the permissions on the target.

It is a QNAP TS-212.
actually it is set by this:
image

If you set the uid to root then it would match the mapping on the client - which is mounted by root.

Instead try removing -p from your rsync command

--perms, -p              preserve permissions

Another option is to experiment with the rsync user and or group mapping to the nas user

--usermap=STRING         custom username mapping
--groupmap=STRING        custom groupname mapping
--chown=USER:GROUP       simple username/groupname mapping

I can only set the UID to guest or userCK

Or do I hve to make an entry in this:
image

the joker is just allowing all ip on the nas network - you don't have to explicit change it for the write to work.

A third option is to use a gio mount in the beginning of your script

gio mount smb://192.168.178.28/backupCK

The resulting mountpoint will be in run/user/$UID/gvfs and have the form

/run/user/$UID/gvfs/smb-share:server=192.168.178.28,share=backupCK

You can use it as target for rsync and when the sync is done

gio mount -u smb://192.168.178.28/backupCK

I just remembered you are using KDE - maybe that is not a good idea - it is work checking though.

Forum kindly sponsored by