2

I have a system which runs an arcade machine. It has the regular swap and root partitions, but then I have an extra partition which I call data. Data holds many gigabytes of game content.

The idea is that if anything goes wrong with the Linux system, I should be able to restore it from a backup and leave /data intact.

My question is, what utility is best to backup and restore just the Linux system partitions? Can I just use dd to make an image of /dev/sda1 and /dev/sda2, for example? What about the MBR - Master Boot Record?

slm
  • 363,520
  • 117
  • 767
  • 871
Cameron Ball
  • 771
  • 2
  • 8
  • 21
  • 1
    `rsync` is good. https://wiki.archlinux.org/index.php/Full_system_backup_with_rsync – Ramesh Jul 01 '14 at 03:04
  • What if a partition becomes corrupt somehow? From what I understand rsync is a fancy copy+paste tool. – Cameron Ball Jul 01 '14 at 03:15
  • 1
    `rsync` is used to preserve the user permissions and other things as well which is why it is more better than copy + paste. From what I believe, you just want your system to be up immediately if it is crashing. You might want to have a script that automatically backs up the root partition to an external HDD. Then when the system crashes, you can restore it from the external HDD. – Ramesh Jul 01 '14 at 03:24
  • 1
    You might want to look into this question as well. http://unix.stackexchange.com/questions/114804/backup-server-users-creation – Ramesh Jul 01 '14 at 03:24
  • 1
    Also take a look at this one: http://unix.stackexchange.com/questions/41399/system-image-of-running-debian-system – slm Jul 01 '14 at 03:34
  • BTW, what's the distro? – slm Jul 01 '14 at 03:36

1 Answers1

1

For simple copying, using rsync to copy to your backup medium, as mentioned in the comments, is sufficient. If you want versioned backups and easier control, rsnapshot is a good choice.

However, for a system partition, there's often an easier option. Since most of the data comes unmodified from your distro's repositories, you can usually manage by simply backing up /etc, /var, and the list of installed packages (which is probably in /var).

Note that none of this will back up the MBR, but on a Linux system, MBR corruption usually results from a failed hard drive.

Mark
  • 4,054
  • 3
  • 26
  • 39