0

I need some help with backing up my linux drive but I do not want to clone it, I need to be able to redistribute the backup onto another drive that is much smaller then the current one.

1 Answer 1

2

You can use rsync command.

how to use rsync for full system backup

rsync -aAXv --exclude={DIRECTORIES TO EXCLUDE} /SOURCEDIR/* /TARGETDIR 

Assuming you want to backup whole system you can run:

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

As mentioned in the above website, you have to exclude paths that are generated dynamically by the system during runtime, or paths used to mount additional devices like usb drives (ex. /media, /mnt).

It would be of course best to do this while in single mode or even better running another system than the one you're backing up - you can also mount the drive as read only - to make sure nothing is attempting to change the files during backup. Just remember to change the SOURCEDIR to current mountpoint of the drive you're backing up

2
  • will it clone the entire system? because I want to put the backup on a 100 gig external drive and currently the system is on a 500 gig hard drive, so if it runs a solid clone, the external drive wont be able to compensate for it
    – Tyler
    Apr 30, 2017 at 14:32
  • @Tyler it should backup whole system, you might want to use also -H option to preserve hardlinks if you want. If files on your system use less than 100GB there should be no problem, otherwise you will have to clean some files or exclude additional directories. You migh want to create some small test instalation and backup it first to make sure everything works as you wanted. To make the system bootable remember to modify /etc/fstab and bootloader entry as needed Apr 30, 2017 at 16:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .