TIP: How to do disk image backups in Ubuntu Linux 10.04

Posted on November 28, 2011 by David Hilowitz

So, I just installed Ubuntu Linux 10.04 on my trusty Toshiba Portege 3480CT8. (Yes, it works beautifully as a lightweight LAMP server.)

One of the first things I set out to do was make a disk image of my new server, so that if something goes awry, I can restore things later on.

Here’s what I did:

First, I plugged my external drive into the USB port. This got assigned to /dev/sdb.   I mounted the drive.

$ sudo mkdir /media/backup_04 
$ sudo mount /dev/sdb1 /media/backup_04 -t ntfs 
$ sudo mkdir /media/backup_04/portege-linux-backups

Next,  I installed dcfldd. This is just like dd, which comes with most Linux distributions, except that it can output time remaining (among other things).

$ apt-get install dcfldd

Finally, I started the backup:

$ dcfldd if=/dev/sda of=/media/backup_04/portege-linux-backups/2011_11_28.img sizeprobe=if

This produces an output that looks like this:

$ [16% of 28615Mb] 155136 blocks (4848Mb) written. 01:17:37 remaining.