How To Backup Your Entire Linux System Using Rsync

Backup Your Entire Linux System Using Rsync

17 Responses

  1. dzs says:

    Greetings Dear Writer!

    This article is look so useful, however I don’t know one thing or maybe I could not solve.

    If I have back up my entire system for a pendrive with rsync – in this case – , what shall I do with the system that the pendrive contains?. May I get an .iso or something else file or can I use for a ‘Live media’?

    Sorry for my bad english and my silly question. 🙂

    Best regards, Laci

    • JSawyer says:

      Hi, Laci. A bit late here!
      You can copy the files to a fresh partition and boot it; there are various guides out there for this.

  2. InvisibleInk says:

    I like to backup only my home directory, minus the hidden dot files. That way, I can get a fresh, clean start on a new distro.

    Here I’m backing up my home folder on an Ubuntu or Ubuntu-based distro to a folder named “synced-backup” on an external USB hard disk with the volume label “Seagate.”

    rsync -r -t -v –progress –delete –exclude=”.*” –exclude “.*/” -s /home/$USER/ /media/$USER/Seagate/synced-backup

  3. H0rnet says:

    Rsync is not a backup tool, instead it’s an efficient way transfer files and directories. It offers no point in time recovery options by it self. If you delete​ something on Monday you wouldn’t​ be able to restore it on Wednesday because Tuesdays backup will also remove the deleted file. You would be better off with a tools like rdiff-backup.

    • Jouni Järvinen says:

      rsync is the way you create incremental backups for instance, so saying it’s not a backup tool is wrong.

  4. Dan St.André says:

    There is a package called LuckyBackyup [http://luckybackup.sourceforge.net/ — I am not affiliated. ] that is a desktop GUI deployment of ‘rsync’ based backup and restore. It runs as two editions: one as end-user; one as root-user. If you really like ‘rsync’ for backup-recovery, I encourage you to take a look at LuckyBackup.

  5. Cesar Jimenez says:

    I modified for faster input instead of
    “/media/*”,”/mnt/*”,”/proc/*”,”/run/*”,”/sys/*”,”/tmp/*”,
    Just use
    /media,/mnt,/proc,/run,/sys,/tmp
    important no space after comma.
    –exclude={/bak1,/cdrom,/dev,/home,/lost+found,/media,/mnt,/proc,/run,/sys,/tmp} / /bak1

  6. Captain Murphy says:

    This was very helpful, thanks!

  7. Søren Holm says:

    Remember –link-dest du allow using hardlinks for unchanged files from the previous backup.

  8. marnixava says:

    “It doesn’t matter if your hard drive is different size, or use different filesystem.”

    Au contraire. Rsync is great, but it *does* matter about the destination file system. For instance, using rsync to back up files in an ext4 file system to a FAT file system, would mean loss of file ownership and permission information. The destination file system needs to have at least the capabilities of the source file system.

  9. HTGeek says:

    SK, I appreciate your efforts. However, IMHO you should make it more forcefully clear to your readers that RSYNC is not a suitable *complete* disk backup solution. It is an excellent *FILE* backup utility. However, it’s not a suitable *DISK* backup utility. The reason why is a disk must be un-mounted prior to backing up or there is a very high chance of file corruption on restore.

  10. dirk says:

    I was looking for a tool or a way to backup and “duplicate” a SD card of a Raspberry Pi. This worked for me.

    Bought a small SSD, did connect it to my running Raspberry Pi with a USB/Sata cable and made 2 partitions on it. Then I copied the boot and root partitions, with Rsync. The files on the root partition as you described. Copied the files on the boot partion with rsync -av.

    I wanted to use it on a second Raspberry Pi to boot from it. I changed the files ‘/boot/cmdline.txt’, ‘/boot/config.txt’ and ‘/etc/fstab’, and changed the file first 2 files on the SD card. After that the 2nd Raspberry Pi (model 3b+) booted from the SSD.

    Awesome, thanks SK.

    Other used links.

    How to boot from a USB mass storage device on Raspberry Pi 3: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md

    Make 2 partitions for the Raspberry Pi (choose 2nd tab):
    https://archlinuxarm.org/platforms/armv6/raspberry-pi

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.