0

I've decided to make a full backup from my SSD disk to flash drive. According to archwiki general backup is done with following command:

rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /* /path/to/backup/folder

But what I supposed to do, if full backup needed? For instance, to launch rsync from usb when basic system would be broken and have fully ready-to-work last working state.

The other detail is that on my primary drive bootloader is GRUB and Syslinux is on usb stick. I'd like to avoid synching this at all. If I understand correctly, "/BOOT/*" should be added to --exclude or maybe there is something else?

  • rsync is a remote sync command. To backup directly to a mounted device you could use many different commands, tar cp fsarchiver to name a few. – bsd Dec 14 '14 at 10:13
  • I guess this is ok for a one-off operation, but not as a regular scheduled backup - copying your whole system file by file to a flash drive will put a lot of wear & tear on it. And a backup on a drive that's failed from excessive writes is rather useless. OTOH, if you back up to a tar archive (or similar) so that you're only writing one file each time you do a backup then the amount of wear & tear will be reduced significantly. – PM 2Ring Dec 14 '14 at 12:24
  • @PM2Ring I am confused, a tar file, while only one file is going to result in more much more information be written to the backup drive than rsync which will only overwrite changed files, or even changed portions of files. Is writing 1000 files of 1 MB each much worse than writing 1 file of 1 GB? – StrongBad Dec 14 '14 at 16:07
  • Fair comment @StrongBad. I guess it depends on how many files get changed in between backups. – PM 2Ring Dec 15 '14 at 4:01
1

This already does a full backup. The contents of the directories that are excluded (such as dev, run, etc) are created in run time and should not be backed up.

Copying boot folder will not override your boot sector, so that is fine.

Using rsync here is the correct method as rsync can work within the same system or remotely and it will also only update changed files, will not keep copying everything every time. If you will be executing this command regularly, you might also want to add '--delete' to the end of the command so it will delete deleted files from the destination.

Additionally, you might want to add '-H' to rsync options for it to preserver hard links.

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.