I want to backup my os disk, I have several os and would love to dd my whole disk

dd if="/dev/sda" | gzip | split -b 1000MiB - "/media/.../backup/us.bin.gz."

but it takes to long and backups are to big, sure dd handles backups with a perfection that rivals that of the Greek gods

Is there a way of making dd backup the boot parts, partition information and only 3 of the 4 primary partitions?

Or what other software can make a backup similar to dd full disk with the exclusion of some partitions (effectively reducing what I need saved from 1000gb to 135gb)?


I assume you are using Ubuntu 14.04 or earlier using the sysinit system and not systemd.

You can run the backup automatically when you power down your system.

If you install your backup script to /etc/rc0.d and name it K9<name>, then it will be called before unmounting all file systems.

When you shut down your system, the script will be called and allowed to run to completion before the system is powered off.

I use this on my home PC to call a script to backup my OS and home drive to a second, bootable hard disk. My script uses rsync and not dd. I use rsync because it is fast: it does an incremental backup.

The backup script should go in /etc/init.d and then be installed using update-rc.d. The script should use template /etc/init.d/skeleton.
See /etc/init.d/README

You can use /etc/init.d/halt as an example because it also has only one 'function'.

I can't attach my scripts because I am at work now.

| improve this answer | |
  • Nice idea, but what about boot data? can rsync copy them to? – Then Enok Sep 24 '15 at 21:09
  • Yes, it can. The only thing it can't copy is the MBR, but that is not necessary: Grub2 is smart enough that it recognises file systems and finds the boot files. I've tested this on my machine - I can boot from the backup disk after rsync had copied a newer version of the Linux kernel. the only thing you have to be aware of is that file /etc/fstab for the backup can be different from the one on the source system: the UUIDs differ. After completing the backup, my backup script overwrites file /etc/fstab on the backup disk with its own. – NZD Sep 25 '15 at 0:07
  • Also, if you are using LVM, you backup disk must have its LVM partition renamed otherwise you can't mount it for rsync to copy the data. I must agree, using dd is simpler, but it always copies everything regardless and thus taking a long time. That is the trade-off: simplicity versus time. – NZD Sep 25 '15 at 0:17

Try Clonezilla. It works very well for cloning partitions.

| improve this answer | |

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.