LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-22-2024, 09:53 AM   #1
linuxbird
Member
 
Registered: Feb 2006
Distribution: Slackware
Posts: 543

Rep: Reputation: 36
Backup and restore on a network with NFS


I would like to use rsync -a to backup large volumes on a distributed server cluster. The specific problem I am having is the saving of permissions, owners and groups of files, so that I can restore them without change.

Specifically, my cluster consists of different Slackware systems (15 and 14.2), which are for the most part a collection of disc drives.

I would like to run rsync, backing up from one machine, and storing the backup file structure on another machine, via NFS. Ideally, the backup tree could be partially or completely be restored if needed.

To maintain integrity in this arrangement, I would like to do the file backup and potentially restores, as root.

Any guidance?

Last edited by linuxbird; 01-22-2024 at 09:55 AM.
 
Old 01-22-2024, 10:00 AM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
I do such backups over nfs. The flags I use are:

Code:
rsync -vaxAX --delete --progress --exclude home/kuo/.cache /mnt/nfs/ella /srv/nfs/
Running as root, this preserves file permissions and ownership. Ideally, you run this from the destination side, because some special permissions can't be written over nfs I think.

It actually is possible to run as a normal user, but of course this will be restricted to the files that the user can access, and it will not preserve ownership.
 
1 members found this post helpful.
Old 01-22-2024, 10:02 AM   #3
linuxbird
Member
 
Registered: Feb 2006
Distribution: Slackware
Posts: 543

Original Poster
Rep: Reputation: 36
BTW, I have no_root_squash specified in the NFS mount.
 
Old 01-22-2024, 11:18 AM   #4
linuxbird
Member
 
Registered: Feb 2006
Distribution: Slackware
Posts: 543

Original Poster
Rep: Reputation: 36
@IsaacKuo, how would you restore from that, and maintain permissions? Assuming that you are restoring from the backup system drive, it would appear to have a problem with root permissions.

In my instance, all systems are running YP/NIS, so the users and groups are the same. But restoring to a root owner seems to be an issue.
 
Old 01-22-2024, 11:39 AM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
I don't understand what you think the problem would be with root permissions.

As long as you're running as root, it will be able to replicate permissions and ownership (including root ownership).
 
1 members found this post helpful.
Old 01-22-2024, 12:37 PM   #6
linuxbird
Member
 
Registered: Feb 2006
Distribution: Slackware
Posts: 543

Original Poster
Rep: Reputation: 36
When I attempt to save to a destination system, I get sh: filename.ext: Input/output error
 
Old 01-22-2024, 12:58 PM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,764

Rep: Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764
I prefer to use real backup solutions for backups, but when I use rsync I never mix it with any remote mount utility.
Rsync does fine syncronization without NFS.
 
Old 01-22-2024, 01:03 PM   #8
lostintime
Member
 
Registered: Dec 2021
Posts: 208

Rep: Reputation: Disabled
I use NFS in the home LAN. I have a shell script on three systems that push backups to a backup server. Probably overkill, but the rsync options:

RSYNC_OPTIONS="-vahPHAEXS --progress --stats --trust-sender --timeout=30 --exclude-from $EXCLUDEFILE"

The reason for some of the options is although the script normally is automated, sometimes I perform backups manually and I like monitoring the progress and status.

The backup server is configured with rsnapshot, a perl script wrapper to rsync. Those backups pull files hourly from other systems, mostly /boot, /etc, /home, /root, /var. I use:

rsync_short_args -a

rsync_long_args --delete --numeric-ids --relative --delete-excluded --trust-sender --timeout=15

Quote:
To maintain integrity in this arrangement, I would like to do the file backup and potentially restores, as root.
I might be reading too much into the statement, but seems you might be hesitant about elevating privileges. Everything in my backup strategy is automated to run with the root user with the cron and at schedulers. All system ownership and permissions are preserved. The only way to preserve everything is with root privileges.

Quote:
Any guidance?
Regularly test restoring files. I test restoring files often and I have tested a worst case scenario of restoring everything to bare metal. A bare metal recovery requires some spare computers. Virtual machines can suffice, but actual hardware is better with exposing various driver issues because in a true disaster recovery likely the replacement hardware will be different from the damaged hardware.

You mention a mixed environment of 14.2 and 15.0 systems. I have a similar environment and also have virtual systems runner older Slackware releases as well as a mixture of 32-bit and 64-bit. That mixture helps create some robust scripts because every system is different. In particular, rysnc changed between 14.2 and 15.0 with new file list safety checks, which for me broke the rsnapshot backups. That is why I use the trust-sender option.

Another item to consider with a mixed 14.2/15.0 environment is keep everything configured to use nfsvers=3 in fstab.

Although three systems push backups, I prefer pulling files to a backup server. The reason is NFS export permissions on the backup server can be configured to read-only. This allows anyone on the LAN to access the backups, but if systems are compromised the malware would not be able to attack the backup files. I like rsnapshot because the basic design is to pull files rather than push.

There are variations, but perhaps look into the "3-2-1" strategy.

I hope that helps!

Last edited by lostintime; 01-22-2024 at 01:05 PM.
 
1 members found this post helpful.
  


Reply

Tags
rsync nfs backup



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba ad dc for windows network - backup and restore bitfuzzy Slackware 4 11-06-2021 08:56 AM
[SOLVED] backup utility in Linux Lite, will not restore backup. dmad71 Linux - Software 5 07-17-2018 07:38 AM
[SOLVED] Backup, shrink backup and modify MBR of backup jps1x2 Linux - General 1 12-17-2013 05:03 AM
[SOLVED] NFS mount fails (times out): NFS server is in DMZ, NFS client is in intranet Hiroshi Linux - Networking 2 05-24-2010 10:22 AM
backup question - NFS share in Ubuntu 9.04 backup to READYNAS NV+ newellrp1 Linux - Newbie 3 05-19-2009 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration