View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > MBR and partition recovery

From LQWiki

Jump to: navigation, search

If - on trying to restore the Master boot record - using the following command

  # dd if=/path/mbr-backup of=/dev/hda bs=512 count=1

a typo was made and the MBR and partition table was destroyed, a recovery procedure may me needed. On an FC3 system testdisk may be used to recover before a reboot.

After gathering information from /proc/partitions and a terminal log showing the results of a previous fdisk, testdisk, and executed:

  # testdisk /log /debug

testdisk presented a menu. Select /dev/hda, and the Analyze command. testdisk presented a guessed partition structure, which looked like the correct structure, but with a different output format. Select the Save command, and then execute fdisk print to compare with the previous fdisk output, finding the same partition structure as before.

testdisk has facilities to solve more complex problems in the partition structure, as well.


Personal tools