How To's
|
Home How To's Linux Recovery Repairing a corrupted Boot Loader on Open SuSE 10.2
|
Repairing a corrupted Boot Loader on Open SuSE 10.2 |
|
|
|
|
Written by Anand
|
|
Apr 18, 2007 at 12:22 PM |
If it ain't broke, don't fix it. This is how we care about Boot Loaders as we never encounter problems with them. If you're a serious Linux Enthusiast who plays around with myriads of Distribution every day and who knows how to play around with the boot loader, this article may not be useful for you. This article is targeted for newbies who just started playing around with Linux especially Open SuSE.
There are many reasons for a boot loader corruption,
- You might have Installed Microsoft Windows after installing Open SuSE (NTLDR could have replaced GRUB in the MBR)
- You played around with the menu list of your boot loader and removed some important entries.
- Your HDD is faulty.
Though there are numerous ways to recover a corrupted Boot Loader, we'll see the easy and newbie friendly ways here.
Option 1
- Power up your system and change the Boot Order in your system BIOS to boot from CD / DVD.
- Insert your Open SuSE 10.2 DVD / CD1 into your drive and boot from it.
- Once you're at the Open SuSE Boot Menu, Select "Installation".
- Follow the instructions such as Language Selection, Licence Agreement etc.
- Select "Other Options" instead of "New Installation" and press "Next".
- Select "Repair Installed System" and Select "Expert Tools" at the bottom of the screen.
- Select "Install New Boot Loader", make the changes required to your Boot Loader and click "Next".
- Finish the Installation and Reboot your system.
- You can either remove the DVD / CD1 or choose "Boot from HDD" in the Boot Menu and you'll find the Boot Loader reinstalled.
If you're a power user or a Linux Enthusiast who would like to do the changes yourself, you may wish to follow Option 2
Option 2
- Power up your system and change the Boot Order in your system BIOS to boot from CD / DVD.
- Insert your Open SuSE 10.2 DVD / CD1 into your drive and boot from it.
- Once you're at the Open SuSE Boot Menu, Select "Rescue System".
- Enter root at the Rescue: Prompt and you'll login as root without a password.
- Once you're in the Rescue System, you can use the available Virtual Terminals using Alt + F1 to Alt + F6
Note:
The shell, mount program and many other utilities can be found in /bin directory. The /sbin directory contains important system files such as fdisk, mkfs, mkswap, mount, init, shutdown etc. Many other tools and applications like vi editor, ssh, find etc can be found in /usr/bin directory.
If you have installed your Open SuSe as a simple configuration with only one / partition things are simple. We presume that you've Windows Installed in your Primary Partition C: first (hda1) and you have D: as well (hda5). Our Linux Installation should obviously be from hda6 onwards.
- To mount the root partition located under /dev/hda6 to the rescue system, type the following command:
mount /dev/hda6 /mnt Now all your directories under your root partition are mounted in /mnt. You can change your directory to /mnt and ensure that you can see all your system directories.
- Now you have to bind the mounted directories to your rescue system directories so that your rescue system points to your actual installed system
mount --bind /dev /mnt/dev
- Now you can change the root partition of your new environment (/mnt becomes your root partition where your system directories are mounted)
chroot /mnt
- You can also mount your /proc and /sys by the following commands
mount /proc mount /sys
- You can then mount all the available partitions from the installed system using the following command:
mount -a
Note:
You have the full access to your installed Linux system now and make sure that you unmount all the partitions using the command "umount -a" before rebooting your system.
- Check whether your GRUB configurations are correct
/etc/grub.conf /boot/grub/device.map /boot/grub/menu.lst
Make the necessary changes to the device.map file if you've changed the root partition etc.,
- You can reinstall the boot loader using the following command
grub --batch < /etc/grub.conf
- Unmount all the mounted partitions and log out from the change root environment, rescue system and reboot the system
umount -a exit reboot
- You can either remove the DVD / CD1 or choose "Boot from HDD" in the Boot Menu and you'll find the Boot Loader reinstalled.
Note:
This applies only when you've installed your Linux system using a single / partition only. If you have configured separate /, /boot, /usr, /root, /home, /var, /temp partitions you may have to mount them separately into /mnt of your rescue system and bind them with your chroot environment
Example:
mkdir /mnt/usr mount /dev/hda8 /mnt/usr (Asssuming that your /usr partition is on hda8) mount --bind /mnt/usr /usr
You may have to follow the same for all your other separate partitions.
Useful Links:
http://en.opensuse.org/SDB:YaST_System_Repair
Please login or register to add comments |
|
Last Updated ( Oct 26, 2007 at 09:15 PM )
|
|
|