Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3552

Raspberry Pi OS • Re: What can I omit from a "rsync" O/S backup?

$
0
0
You can safely leave out all the virtual filesystems (/proc, /sys, /dev, etc) and /tmp.

For systems where everything is on a single drive with just boot and root partitions, assuming target drive has just one partition, and that you don't mind not having the boot files in the root partition backup I use the following:
  1. Mount the target drive somewhere e.g. /mnt
  2. Get a command line
  3. Code:

    sudo rsync -axrvHA / /mnt/
  4. One of the following depending on where your chosen OS mounts the boot partition:
    • Code:

      sudo rsync -axrvHA /boot /mnt/boot/
    • Code:

      sudo rsync -axrvHA /boot/firmware/ /mnt/boot/firmware/
The rsync options are:
a: archive mode
x: do not cross file system boundaries
r: recurse into directories
v: verbose
H: preserve Hardlinks
A: preserve ACLs

x is needed not just because you don't want to backup the backup onto the backup but also to prevent backup of the virtual filesystems. The downside is that you need to rsync the boot partition separately.

Statistics: Posted by thagrol — Mon Sep 30, 2024 4:46 pm



Viewing all articles
Browse latest Browse all 3552

Trending Articles