Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Before I installed Ubuntu on my old computer, I took backups of both partitions with dd. Long story short: I now want to restore these two files, XP.dd and Storage.dd, to the computer again. How do I do this?


This question is related: NTFS backup image wont mount

share|improve this question
up vote 0 down vote accepted

When people do the dd option to backup an image of a partition, they often fail to backup the partition table as well...If you didn't you can try creating partitions of similar sizes with fdisk or whatever and set the partition flags appropriately. then dd them back and run whatever disk checking utility suits the partition in question from a bootable CD. It has worked before....

slightly more detail:

ls -l imagename #to get the size  
sudo fdisk /dev/sdX  

n adds a new partition #follow the prompts, make a modestly larger partition and resize if the fix works
t sets the partition type in the partition table
w writes the changes to the disk
(m lists options as the program informs you) dd if=imagename of=/dev/sdXY run appropriate disk check utility after the dd restore is complete there are better ways to do this they aren't horribly relevant and are overly complicated

share|improve this answer
When do one need to backup the partition table/MBR? Initially I only needed to backup the OS partition – Znarkus Nov 21 '10 at 20:08
I back up the WHOLE disk with a dd if=/dev/sdX as opposed to sdXY...that way I can treat it like a disk instead of worrying with complications relating to re-integration later....I can always delete partitions I don't need and resize. I would rather have it and not need it, than need it and not have it. – RobotHumans Nov 22 '10 at 3:20
additional note: there are multiple questions on this particular forum about difficulties in mounting individual partition images...i have none of these problems with my method. it is unnecessary, but it is simple. i like simplicity. – RobotHumans Nov 22 '10 at 3:23
I created two partitions, dd'd the images to them, but then I'm stuck trying to install MBR/bootloader. Do you have a suggestion how to do this? :) – Znarkus Jul 18 '11 at 20:53

I think you should only dd back the img data to partiton. example(boot with live ubuntu, expected /dev/hda1 is the restoreable partition, unmount it first, if it mounted):

# umount /dev/hda1
# dd if=/path/to/image.dd of=/dev/hda1
# mount /dev/hda1 /path/to/mount

After you checked the data, reboot, or set correctly your fstab. Please give more info, for more help!

share|improve this answer
Isn't /dev/hda1 the first partition? Mustn't I create that first? What info do you need? – Znarkus Nov 21 '10 at 20:00
Yes, this is the first, but it is only an example. You sure, that you must create it first, but I thought that you did it, or you backuped the /dev/hda (the partition table). I thought, you may write, what partition is that, and ask concrate question about this problem. – antivirtel Nov 21 '10 at 21:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.