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.
- 24,696
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
- 109,787
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
ddfrom 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
pvfrom terminal or script Makes duplicate of whole disk including partitions. This is faster thenddand 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)