MBR recovery and grub reinstall

January 9, 2010

In the event that partition table is corrupted or boot loader has gone, here are some steps that you can take in order to boot the system as normal.

I hope that you have taken the backup of partition table previously with the command;

#sfdisk -d /dev/sda > /root/sda_partition_table.out

Or if you also want to backup the whole MBR to a file do this;

#dd if=/dev/sda of=/tmp/mbr_sda.out bs=512 count=1

From now on, I assume that you have booted the system in rescue mode with networking support.

1) The first thing is to paste this partition table back into its original space. Presumably, you have copied the partition table from network and put it under /tmp/sda_partition_table.out

#sfdisk /dev/sda <  /tmp/sda_partition_table.out

This will fix your partition table. Now time to fix MBR

2) As the MBR has gone, we have to write MBR again. Do the followings;

#grub

grub> root (hd0,0)
grub>setup (hd0)
grub>quit

The root (hd0,0) command assumes that your boot partition is in /dev/sda1

After these commands, you should be able to boot your system as before.

tags:
posted in gnu/linux by admin

Follow comments via the RSS Feed | Leave a comment | Trackback URL

2 Comments to "MBR recovery and grub reinstall"

  1. GREG wrote:


    Pillspot.org. Canadian Health&Care.Special Internet Prices.Best quality drugs.No prescription online pharmacy. High quality drugs. Order drugs online

    Buy:Mega Hoodia.Synthroid.Human Growth Hormone.Accutane.Petcam (Metacam) Oral Suspension.100% Pure Okinawan Coral Calcium.Retin-A.Lumigan.Prednisolone.Arimidex.Zyban.Actos.Zovirax.Nexium.Valtrex.Prevacid….

  2. lift wrote:

    wall http://yofficeotsf2.02JEEPPARTS.US/tag/wall+hugger+Seat+lift/ : wall…

    wall…

Leave Your Comment

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org