Hi guys,
I am here again with a new post. And this post is very demanding for any Linux home user because we use many OSes at home. These can be either Windows or Linux/Unix or any other. If a user installs Windows after Linux. Then, windows will write its boot-loader in MBR(Master Boot Record). So, now what the problem is, that you won't be able to boot in linux.
So, now to boot into linux you need the boot-loader. So, we will reinstall boot-loader grub in the MBR once again. This process is called "rescuing the broken system" or "Rescuing Grub".
I am using RHEL 5 in my case.
Prerequisites:
- Installation media CD/DVD containing Linux install image or USB or a server running DHCP server on network for PXE boot to start installation process
- A broken system (system without GRUB)
Steps to go:
1) Insert the boot media into the cd-rom (in case you have CD/DVD) else boot from USB or network. When the boot screen comes up, pass the parameter to boot in desired environment. Since we are trying to fix a broken system we will pass "linux rescue" as our parameter and press "enter".
# boot: linux rescue
2) Then, it will ask you for various things like keyboard layout and language, network interfaces to start or not etc and finally the rescue environment warning page will come up. Read that carefully.
Press "continue" it will start searching for your partition and mount it under "/mnt/sysimage" and drop you to a shell. Now do as:
# chroot /mnt/sysimage
-changing root environment to the broken system
3) Now, its time to run the command that fixes your system and installs grub:
# grub-install /dev/sda
- use "sda" for SATA disks and "hda" for IDE disks
or
Invoke Grub and use its command-line to fix as:
# grub
grub> find /etc/passwd
- this checks that on which partition this file exists, you will get the output something like "(hd0,1)" or may differ according to your partition scheme. So use yours. "hd0" means first harddisk and "1" means the second partition. If it is "0" in place of "1" then it will be first partition.
grub> root (hd0,1)
grub> setup (hd0)
grub> quit
# exit
4) Finished.....You are done....:)
Now boot into your linux and have fun......:)
Different Linux distros might have different ways to rescue. So read there help first. You can get key parameters to boot from the boot media help by pressing function keys(F1,F2,F3.......).
No comments:
Post a Comment