rear icon indicating copy to clipboard operation
rear copied to clipboard

BACKUP_PROG=rsync: Is it possible to backup and restore to/from an NFS share that has root squash enabled?

Open scook207 opened this issue 1 year ago • 5 comments

I'm trying to use rsync to backup to an NFS share with root squash enabled. It's not clear to me what root squash enabled means, but I believe all root file permissions are mapped to the nobody user.
I'm getting lots of errors like the one below in the rsync-.log file:

2024/12/07 14:54:28 [17059] rsync: chown "/tmp/rear.CClpFWqalqYxnZo/outputfs/watch/backup/home/bs/.cache/evolution/addressbook" failed: Operation not permitted (1)

AI and Google searches indicate that this is being caused by "root squash enabled" on the NFS share. AI suggests adding these options to the rear command:

sudo rear -v mkbackup -- --rsync-options="--no-owner --no-group"

I suspect that if I use those options, then I'll be unable to perform a restore from the backup since all the file permissions will be set to nobody:nobody.

Any tips on how to configure Relax-and-Recover to backup to an NFS share with root-squash enabled?

Happening on serveral servers. Right now I'm troubleshooting a RHEL 6.10 server running ReaR 2.4.

Thanks, SC

scook207 avatar Dec 10 '24 16:12 scook207

-- --rsync-options="--no-owner --no-group"

I am afraid that AI has made that up.

pcahyna avatar Dec 10 '24 17:12 pcahyna

Please show your local.conf file (without any passwords / secrets of course)

pcahyna avatar Dec 10 '24 17:12 pcahyna

Looks like site.conf is being used to configure rear. Here are the contents:

BACKUP=NETFS BACKUP_PROG=rsync BACKUP_URL=nfs://hetnas1/mnt/tank/backups/rear_backups AUTOEXCLUDE_AUTOFS=y BACKUP_RSYNC_OPTIONS=(--sparse --archive --hard-links --numeric-ids --stats --log-file="$LOG_DIR/rsync-$HOSTNAME.log") BACKUP_OPTIONS=nfsvers=3,nolock

local.conf contains the commented out default message "This file etc/rear/local.conf..."

Thanks, SC

scook207 avatar Dec 11 '24 15:12 scook207

@scook207 Why not using the BACKUP=RSYNC workflow? Have a look at /usr/share/rear/conf/default.conf file for how-to...

gdha avatar Dec 17 '24 13:12 gdha

@scook207

BACKUP=NETFS
BACKUP_PROG=rsync

I see, not sure if there is some rsync trick to make it work under such conditions (you can try --fake-super, but you will need extended attributes enabled on the share). The easiest option is to use tar (which is the default for BACKUP_PROG ) instead of rsync, if a single tarball as the backup is enough for you. Another option is to use BACKUP=RSYNC as @gdha has suggested, if rsync can connect to your backup location (either over ssh or over the rsync protocol).

pcahyna avatar Dec 17 '24 15:12 pcahyna