Terminus Logo

Question ? How to reinstall grub from a rescue mode ?  

 Boot into a ubuntu "try" mode or whatever linux system that provides you the possibility to manipulate the harddisk.
You first need to prepare the environment

root@ubuntu:~# mkdir /sda
root@ubuntu:~# mount /dev/sda3 /sda    # this is the / of the existing system
root@ubuntu:~# mount -o bind /dev /sda/dev
root@ubuntu:~# mount -o bind /proc /sda/proc
root@ubuntu:~# chroot /sda /bin/bash
[root@ubuntu /]# mount /dev/sda1 /boot

Then - Install GRUB

[root@ubuntu /]# grub

    GNU GRUB  version 0.95  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
 Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub.conf"
 \ ... succeeded
Done.

grub>quit
[root@ubuntu /]#

After that - undo whatever you have done in reverse order

[root@ubuntu /]# umount /boot
[root@ubuntu /]# exit
root@ubuntu:~# umount /sda/proc
root@ubuntu:~# umount /sda/dev
root@ubuntu:~# umount /dev/sda3

If you reboot - you should see a grub prompt as usual. 

Entered by smurphy on Friday, 15 October 2010 @ 11:25:36  
Linux General - Common Linux problems, # Hits: 88728

Next  How can I boot from the SATA drive 2 of a Software Raid-1 System ? 

This page was issued from the Terminus Website:
https://www.solsys.org

The URL for this page is:
https://www.solsys.org/mod.php?mod=faq&op=view&faq_id=154


  Close