I have a laptop with Windows 10 and Ubuntu 14.04. I would like a quick process to perform nightly backups of the entire hard drive. The ideal scenario would be to plug laptop into a hard drive, boot from either the laptop or hard drive, and run an application which backs-up all changes since the last backup.
4 Answers
A good option might be the built-in backup utility, Deja-Dup. You will have to do a little configuring to make sure all the folders you care about are included, but it provides a straightforward GUI to do so. Once you are set up, it will do a full backup. It will then do incremental backups whenever you like. Every 90 days or so it will do another full backup.

- 23,641
- 15
- 70
- 122
-
This would handle Ubuntu files well, but does it handle files on multiple partitons? I suspect that what I'm looking for is more like cloning a hard drive than backing up a directory. – Daniel Arnett May 19 '16 at 18:50
To do multiple partition backup, you can use:
Clonezilla. Its very reliable and stable.
Also you can use Bacula.
Bacula is a set of computer programs that permit managing backup, recovery, and verification of computer data across a network of computers of different kinds. Based on Source Forge downloads, Bacula is the most popular Open Source backup program.Bacula

- 107,631
-
Can systemback backup multiple partitions, or just my ubuntu partition? – Daniel Arnett May 19 '16 at 20:34
-
I haven't tried it, but I don't see why not. I'll try it later on, and let you know. – Mitch May 19 '16 at 21:41
-
-
I don't think that systemback will do multiple partitions. I have updated the answer, with other options. – Mitch May 21 '16 at 07:12
You have several options. Considering the disk for storing backup is of same size (or larger) as the source disk and is mounted, then you can use the following tools in the form on a script which runs periodically using cron
. Advantage to such cloning for backup is that, if your source hard-drive fails you can simply use the backup drive and it will retain all partitions as such.
- Using
dd
from terminal or script
This is used to make a copy/duplicate of the whole disk (meaning full physical disk including partitions).
Pro: It is optimized for such cloning purpose. User can specify block size, and other parameters. Cons: It is slow and the speed optimization needs trying out different block sizes. Also, blank space is also copied.
dd if=<input_disk> of=<backup_disk or file> bs=2048
For example, input disk= /dev/sdx
& output disk = /dev/sdy
or . Use lsblk
in terminal to get the device id.
Above example does not show the progress bar. You can use pv
in conjunction with dd
to get progress bar. This is available here Progress bar in dd
Like ,
sudo dd if=/dev/sdx | pv -s 2G | dd of=/dev/sdy bs=4096
Explanation: pv
will check for time and transfer after every 2 Gb of data moved and report. (You need to install pv
before using the above mentioned command.)
*A bash shell script using dd
with backup file check and logging option is available here
(The user needs to edit the backup file path, and source drive ID to use it. It can be set as cron job. )
Restoring from such a backup image is by following command where of=new_disk
,
dd if=/path/to/backup.img of=/dev/sdn
- Using
pv
from terminal or script Makes duplicate of whole disk including partitions. This is faster thendd
and uses maximum possible throughput available to the disks.
After installation using sudo apt-get install pv
you can simply run as,
sudo pv < /dev/sdx > /dev/sdy
This will clone the disk /dev/sdx
to /dev/sdy
PS- It is suggested that you run some command with sudo in the terminal before running this, since it will ask for permission. Also, this does not show progress, and the terminal will be busy for a while depending how big the backup is.
*A bash script using pv
to make backup image is available here.
User needs to edit the backup file path. Use cronjob to set it up for periodic run. Use crontab -e
to run as root.
Restoring from such a backup image is by following command where /dev/sdn
is the new disk,
pv < /path/to/backup.img > /dev/sdn
Another option is Clonezilla (mentioned by @Mitch)
-
I suggest editing above to add details about Clonezilla if possible. – ankit7540 May 21 '16 at 07:46
-
@Daniel Arnett : If you need a script I can write one for doing full disk clone using either
dd
orpv
. – ankit7540 May 21 '16 at 07:47 -
Awesome, well they both look like they'll do the trick. Even though I'm booting from the hard drive that's being backed up I'll still be able to read and copy every bit from the disk? Also I want to minimize read/writes between disks so I don't harm either drive with nightly full-disk operations. Finally could I have multiple backups on one large external drive? – Daniel Arnett May 21 '16 at 13:18
-
First question: Yes it is possible. It is recommended not to work with files and update apps while doing this. Second question: yes, also possible. We can make image of the hard-drive and store it and multiple such images can be maintained. I'll write a small script and post later with the answer. – ankit7540 May 21 '16 at 16:31
-
I have added two scripts ( using
dd
andpv
) to make backup file asbackup_date.img
. Restoring from this backup is also simple. If you have any problem in deploying the script feel free to ask. – ankit7540 May 23 '16 at 06:03 -
Excellent, thank you @ankit7540 and to everyone in this thread for helping a lowly +3 user in AskUbuntu. I'll buy a hard drive this week to test this. – Daniel Arnett May 23 '16 at 11:04