Table of Contents

Using disk images

You can use the command line to work with disk images and backups, without any extra software.

Create a hard disk image

sudo dd if=/dev/hda1 of=/home/hda1.bin

Or for a compressed disk image:

sudo dd if=/dev/hda1 | gzip > /home/hda1.bin.gz

Back up and restore the MBR

sudo dd if=/dev/hda of=/home/hda.boot.mbr bs=512 count=1

Restore MBR (from a Live CD)

sudo dd if=/mnt/hda1/home/hda.boot.mbr of=/dev/hda bs=512 count=1

Backup a drive to another drive

sudo dd if=/dev/hda of=/dev/hdb conv=noerror,sync bs=4k

Write an Ubuntu ISO to USB

Assuming your USB stick is /dev/sdb, don't use the partition (/dev/sdb1):

sudo dd if=Ubuntu.iso of=/dev/sdb