Difference between revisions of "HowTo Recreate Grub Install And The Master Boot Record (MBR) If Corrupted"

From NST Wiki
Jump to navigationJump to search
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
This '''HowTo''' shows the steps one can used to recreate a corrupt '''[http://en.wikipedia.org/wiki/GNU_GRUB grub]''' boot loader and/or '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' on an '''NST''' system. Start by <i>booting</i> up "'''NST Live'''" or '''NST''' on a "'''USB Flash Drive'''" hard disk install. This example assumes the corrupt '''[http://en.wikipedia.org/wiki/GNU_GRUB grub]''' and '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' is on the disk associated with device name: "'''/dev/sda'''" were partition: "'''/dev/sda1'''" is used for '''[http://en.wikipedia.org/wiki/GNU_GRUB grub]''' and the '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' is on "'''/dev/sda'''" sector 0.   
+
* '''Problem:''' When booting '''NST''' from a hard disk install and you see the message: "'''<u>Disk</u> <u>Error</u>'''" (or something similar) on the screen after '''[http://en.wikipedia.org/wiki/Power-on_self-test POST]'''.
 +
 
 +
* '''Solution:''' Typically, this is associated with a corrupt '''[http://en.wikipedia.org/wiki/GNU_GRUB grub]''' install and/or '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' on the hard disk. Use this '''HowTo''' to help recreate the '''[http://en.wikipedia.org/wiki/GNU_GRUB grub]''' install and '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' to help resolve this issue.
 +
 
 +
 
 +
This '''HowTo''' shows the steps one can used to recreate a corrupt '''[http://en.wikipedia.org/wiki/GNU_GRUB grub]''' boot loader install and/or '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' on an '''NST''' system. Start by ''booting'' up "'''NST Live'''" ('''DVD''' or '''USB Flash Drive''') or '''NST''' on a "'''USB Flash Drive'''" hard disk install. This example assumes the corrupt '''[http://en.wikipedia.org/wiki/GNU_GRUB grub]''' install and/or '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' is on the disk associated with device name: "'''/dev/sda'''" were partition: "'''/dev/sda1'''" is used for '''[http://en.wikipedia.org/wiki/GNU_GRUB grub]''' and the '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' is on "'''/dev/sda'''" sector 0.   
  
 
* '''1)''' Make sure that there are no mounts using the "'''/boot'''" mount point:  
 
* '''1)''' Make sure that there are no mounts using the "'''/boot'''" mount point:  
Line 23: Line 28:
 
</pre>
 
</pre>
 
</div>
 
</div>
 +
 +
 +
 +
* '''3)''' Mount "'''/boot'''" using partition: "'''/dev/sda1'''":
 +
<div class="screen">
 +
<div class="userInput"><span class="prompt">[root@probe ~]# </span>mount -v /dev/sda1 /boot</div>
 +
<pre class="computerOutput">
 +
mount: you didn't specify a filesystem type for /dev/sda1
 +
      I will try type ext3
 +
/dev/sda1 on /boot type ext3 (rw)
 +
</pre>
 +
<div class="userInput"><span class="prompt">[root@probe ~]# </span>df</div>
 +
<pre class="computerOutput">
 +
Filesystem          1K-blocks      Used Available Use% Mounted on
 +
/dev/mapper/vg_probe-lv_root
 +
                    235338552  4335136 228613664  2% /
 +
/dev/sda1              198337    22358    165739  12% /boot
 +
tmpfs                  1419416        0  1419416  0% /dev/shm
 +
[root@probe ~]#
 +
</pre>
 +
</div>
 +
 +
 +
* '''4)''' Reinstall '''[http://en.wikipedia.org/wiki/GNU_GRUB grub]''' and the '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' on the hard disk ('''/dev/sda'''):
 +
<div class="screen">
 +
<div class="userInput"><span class="prompt">[root@probe ~]# </span>grub-install --root-directory=/ /dev/sda</div>
 +
<pre class="computerOutput">
 +
Installation finished. No error reported.
 +
This is the contents of the device map //boot/grub/device.map.
 +
Check if this is correct or not. If any of the lines is incorrect,
 +
fix it and re-run the script `grub-install'.
 +
 +
# this device map was generated by anaconda
 +
(hd0)    /dev/sda
 +
[root@probe ~]#
 +
</pre>
 +
</div>
 +
 +
One can review the "'''[[HowTo Backup And Restore The Master Boot Record (MBR) | Backup And Restore The MBR]]'''" '''HowTo''' document as an alternative method for resolving this issue.

Latest revision as of 11:08, 26 October 2009

  • Problem: When booting NST from a hard disk install and you see the message: "Disk Error" (or something similar) on the screen after POST.
  • Solution: Typically, this is associated with a corrupt grub install and/or MBR on the hard disk. Use this HowTo to help recreate the grub install and MBR to help resolve this issue.


This HowTo shows the steps one can used to recreate a corrupt grub boot loader install and/or MBR on an NST system. Start by booting up "NST Live" (DVD or USB Flash Drive) or NST on a "USB Flash Drive" hard disk install. This example assumes the corrupt grub install and/or MBR is on the disk associated with device name: "/dev/sda" were partition: "/dev/sda1" is used for grub and the MBR is on "/dev/sda" sector 0.

  • 1) Make sure that there are no mounts using the "/boot" mount point:
[root@probe ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_probe-lv_root
                     235338552   4335136 228613664   2% /
/dev/sdb1               198337     22358    165739  12% /boot
tmpfs                  1419416         0   1419416   0% /dev/shm
[root@probe ~]#


  • 2) Unmount "/boot" if currently mounted:
[root@probe ~]# umount -v /boot
/dev/sdb1 umounted
[root@probe ~]#


  • 3) Mount "/boot" using partition: "/dev/sda1":
[root@probe ~]# mount -v /dev/sda1 /boot
mount: you didn't specify a filesystem type for /dev/sda1
       I will try type ext3
/dev/sda1 on /boot type ext3 (rw)
[root@probe ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_probe-lv_root
                     235338552   4335136 228613664   2% /
/dev/sda1               198337     22358    165739  12% /boot
tmpfs                  1419416         0   1419416   0% /dev/shm
[root@probe ~]#


  • 4) Reinstall grub and the MBR on the hard disk (/dev/sda):
[root@probe ~]# grub-install --root-directory=/ /dev/sda
Installation finished. No error reported.
This is the contents of the device map //boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(hd0)     /dev/sda
[root@probe ~]#

One can review the " Backup And Restore The MBR" HowTo document as an alternative method for resolving this issue.