0

Trying to rsnapshot to an nfs share I get some ownership and access errors, even if I can visibly do any operation on my shares with UID 1000 and GID 1000 on both server/client.

Server exports

/etc/exports

# Data (insecure for MACOS clients)
/mnt/data       172.16.10.0/24(rw,sync,no_subtree_check,insecure)

Client mounted directory

/etc/systemd/system/mnt-data.mount

[Unit]
Description=ServerData
After=network.target

[Mount]
What=172.16.10.171:/mnt/data
Where=/mnt/data
Type=nfs
Options=_netdev,auto

[Install]
WantedBy=multi-user.target

Error got in crons

require Lchown
Lchown module loaded successfully
Setting locale to POSIX "C"
echo 24722 > /var/run/rsnapshot.pid
mv /mnt/backups/vmDebDevSrv1/alpha.1/ /mnt/backups/vmDebDevSrv1/alpha.2/
/bin/cp -al /mnt/backups/vmDebDevSrv1/alpha.0 \
    /mnt/backups/vmDebDevSrv1/alpha.1
/bin/cp: cannot access '/mnt/backups/vmDebDevSrv1/alpha.0/localhost/usr': Permission denied
/bin/cp: failed to preserve ownership for '/mnt/backups/vmDebDevSrv1/alpha.1/localhost/usr': Operation not permitted
/bin/cp: cannot access '/mnt/backups/vmDebDevSrv1/alpha.0/localhost/var': Permission denied
/bin/cp: failed to preserve ownership for '/mnt/backups/vmDebDevSrv1/alpha.1/localhost/var': Operation not permitted
/bin/cp: failed to preserve ownership for '/mnt/backups/vmDebDevSrv1/alpha.1/localhost': Operation not permitted
/bin/cp: failed to preserve ownership for '/mnt/backups/vmDebDevSrv1/alpha.1': Operation not permitted
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot alpha
----------------------------------------------------------------------------
ERROR: /bin/cp -al /mnt/backups/vmDebDevSrv1/alpha.0 /mnt/backups/vmDebDevSrv1/alpha.1 failed (result 256, exit status 1).
ERROR: Error! cp_al("/mnt/backups/vmDebDevSrv1/alpha.0/", "/mnt/backups/vmDebDevSrv1/alpha.1/")
/usr/bin/logger -p user.err -t rsnapshot[24722] /usr/bin/rsnapshot alpha: \
    ERROR: Error! cp_al("/mnt/backups/vmDebDevSrv1/alpha.0/", \
    "/mnt/backups/vmDebDevSrv1/alpha.1/")
rm -f /var/run/rsnapshot.pid 
0

Still not sure but adding vers=3 as mount option solved my issue, as mentionned in many parts the version 4 of nfs server does manage rights through ACL....

So my /etc/systemd/system/mnt-data.mount should look like

[Unit]
Description=ServerData
After=network.target

[Mount]
What=172.16.10.171:/mnt/data
Where=/mnt/data
Type=nfs
Options=_netdev,auto,vers=3

[Install]
WantedBy=multi-user.target

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.