-1

At the moment, I have an Ubuntu 11.04 installation on a single 500GB hard drive in my laptop. The hard drive is partitioned into four parts: 500MB for the boot information, 2GB for the swap partition, 195GB for the home folder and the remainder of the space for the rest of the installation. The two latter partitions are extended partitions, and all partitions (except the swap) are ext4.

I want to format the hard drive in preparation for installing Arch Linux on this laptop. However, if things go wrong, or if I decide I don't want to use it any longer for whatever reason, I want to be able to restore my Ubuntu installation exactly as it was before I formatted the hard drive. This means I want something that's going to backup the MBR and the partition table.

Is using dd the best way to accomplish this? If so, is there anything I need to be wary of when using it to perform the operation (other than ensuring the filesystems are unmounted and that I don't confuse if and of)? Is there anything else I need to worry about? Is there anything I need to worry about when restoring the image?

If not, what is the best way of achieving this?

Matthew G
  • 101
  • 1
  • 1
    dd is the right tool to use for the purpose. See: http://www.cyberciti.biz/faq/howto-copy-mbr/ – Valentin Bajrami Nov 21 '12 at 12:52
  • If I use dd to backup the entire hard drive, not just the first 512 bytes, I assume that will include the MBR. What about the partition table? Do I need to use sfdisk to do that, or will using dd to copy the entire disk do that for me? – Matthew G Nov 21 '12 at 12:57
  • `dd` will clone the *entire* disk with the side-effect that you must use a disk at least as big as the original one to restore and will loose the additional space of a larger disk in the first step of a restore (can usually be corrected afterwards). – Sven Nov 21 '12 at 13:05
  • So just to make sure it's explicit, using dd means I won't need to backup the partition table individually? – Matthew G Nov 21 '12 at 13:27
  • If you clone the *device* (e.g. /dev/sda) you get the partition table in the clone. If you clone a *partition* (e.g. /dev/sda1, /dev/sda2) you must recreate them manually to restore. – Chris Nava Nov 21 '12 at 14:19

1 Answers1

2

The best way is to backup complete hard drive with its structure or a Complete clonign, use CloneZilla, which has a Live CD, and you can save complete image of your hard drive on a USB Hard drive. backup/restoration is brilliant in it. i had been using it for many years to backup and restore server.

Farhan
  • 4,210
  • 9
  • 47
  • 76