SDB:Howto repair boot manager Grub on opensuse 10.3
From openSUSE
Version: 10.3
Contents |
Situation
You have installed or updated to opensuse 10.3. Now for some reason the installed Linux does not start any more. The boot process stops with a message like "GRUB", which tells you that the installed Linux boot manager GRUB is broken.
This can happen for example when you install Windows after Linux or if you change a partition size on this harddisk.
Normally you now would use the opensuse CD/DVD to start the installed Linux system and then let yast repair the boot manager. But with opensuse 10.3 you now have the additional problem that the helpful options "Automatic Repair mode" and "Start installed system" in the installation menu of the opensuse 10.3 CD/DVD don't work.
Procedure
The article describes solutions to repair the boot manager GRUB without the help of the emergency modes "Automatic Repair mode" and "Start installed system" of the opensuse 10.3 CD/DVD.
Quick nearly-automatic repair
Use the Super Grub Disk to repair the boot manager. Download the ISO-image of this CDROM from the english web page http://www.supergrubdisk.org/ or http://supergrub.forjamari.linex.org/ or from the german web page http://sgd.linux-beginnerforum.de/ . Make a bootable CDROM from this file sgd_0.XXXX.iso. For this you have to use in your burning program a specialized option for ISO-images, otherwise the CDROM will not work!
-Boot your computer with your SuperGrub CDROM.
-Select "GRUB => MBR & !LINUX! (>2) MANUAL |8-)"
-Select the Linux installation you want to recover.
-Select the Linux installation you want to boot.
-Your Linux should boot.
-On next reboot Linux boot should be fixed.
Slow nearly-automatic repair
Use the Super Grub Disk to repair the boot manager. Download the ISO-image of this CDROM from the english web page http://www.supergrubdisk.org/ or http://supergrub.forjamari.linex.org/ or from the german web page http://sgd.linux-beginnerforum.de/ . Make a bootable CDROM from this file sgd_0.XXXX.iso. For this you have to use in your burning program a specialized option for ISO-images, otherwise the CDROM will not work!
-Boot your computer with your SuperGrub CDROM.
-Select "English Super Grub Disk" or another language.
-Select "Gnu/Linux".
-Select "Fix Boot of Gnu/Linux (GRUB)".
-Select your Linux partition.
Now your bootloader GRUB should be fixed.
Boot your system and repair it then "from inside"
-Boot your computer with your SuperGrub CDROM.
-Select "English Super Grub Disk" or another language.
-Select "Gnu/Linux".
-Select "Boot Gnu/Linux" or select "Boot Gnu/Linux directly".
-Now your linux is started and you can fix the bootloader problem with yast2.
More information on the SuperGrub Disk can also be found here: http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html
Manual repair on the command line
It is also possible to repair GRUB manually. For example the german webpage http://linuxwiki.de/GRUB gives some hints on this topic. For detailed information about Grub read the SDB page: http://en.opensuse.org/SDB:The_Boot_Manager_Grub.
For the repair procedure you have to know the root partition of your installed linux system.
Keep in mind that there are different naming standards for partitions under linux: in most linux systems the name "/dev/sda6" means that this is the 6th partition on the first IDE harddisk. Opensuse 10.3 sees the same partition as "/dev/sda6" (because of libata, see Release Notes of 10.3). GRUB starts numbering everything at zero, so it calls the same partition "hd0,5".
On a dual-boot system with Windows and opensuse the root partition is probably "/dev/sda6". You can also use Grub to find the root partition: start the Rescue System from the opensuse CD, then start grub, then enter "find /boot/vmlinuz" to find the linux kernel. Grub answers for example with "(hd0,5)". This means that (hd0,5) is your root partition in Grub's naming scheme. Another way is to boot from a Live-CD with a partition editor like the "GParted Live-CD" and have a look at the installed linux partitions.
- Boot from the opensuse CD/DVD, then from the first menu start the "Rescue System" and login.
- To make the root partition "/dev/sda6" accessible enter:
mount -t ext2 -o rw,dev /dev/sda6 /mnt
- To find out the file names of your kernel and initrd files enter:
ls /mnt/boot
- Write down the file name starting with "vmlinuz-2.6" (installed linux kernel) and the file name starting with "initrd-2.6" (installed initial ramdisk). You maybe need this some steps later. On my opensuse 10.3 system they are:
vmlinuz-2.6.22.9-0.4-default initrd-2.6.22.9-0.4-default
- Enter the command "grub", to start the command line interface of Grub.
- Now we tell Grub where the root partition is. For root partition "/dev/sda6" enter:
root (hd0,5)
- Then we setup the Master Boot Record of the harddisk:
setup (hd0)
- Finally enter "quit" and "reboot".
- Your installed system is started now, you're done. If Grub still stops with an error continue with the next steps.
- Grub should now show its boot menu. To fix the errors in the menu lines you can now use the written down file names from above. Edit a line with "e", finish editing with "<ENTER>", write down what you did and then try to boot with "b". In the editing mode you can also use TAB-completion like in the bash-shell to find out the exact vmlinuz... and initrd... file names. For example on my system with opensuse 10.3 and root partition "/dev/sda6" there are the menu lines
root (hd0,5) kernel /boot/vmlinuz-2.6.22.9-0.4-default root=/dev/sda6 vga=0x31a resume=/dev/sda5 splash=silent showopts initrd /boot/initrd-2.6.22.9-0.4-default
- Finally do not forget that the above changes to the menu lines are only temporary, so you still have to fix the menu lines with yast. Here you can use your written down good menu lines from above.
Have a lot of Fun !
Links
- http://www.supergrubdisk.org/ (SuperGrub Disk, english)
- http://sgd.linux-beginnerforum.de/ (SuperGrub Disk, german)
- http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html (SuperGrub informations, english)
- http://en.opensuse.org/SDB:The_Boot_Manager_Grub (Detailed Grub informations)
- http://linuxwiki.de/GRUB (Grub emergency informations, german)
- http://gparted.sourceforge.net (GParted Live-CD, very good partition editor tool)
Keywords: grub | boot | bootmanager | bootloader | 10.3

