4

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?

Thanks!

This question is related: NTFS backup image wont mount

2 Answers2

4

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!

antivirtel
  • 3,685
2

When people use dd 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 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.

Slightly more detailed:

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

Options:

  • 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.

Then run:

sudo dd if=imagename of=/dev/sdXY

Run the 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.

RobotHumans
  • 30,112