Rescue Mode
Rescue Mode
Rescue Mode
MODE######################################
1:
#vi /etc/grub.conf
In this file :
root (hd0,2) just change this to
root (hd1,2)
By doing this the system will not be able to boot properly.
so we have to edit the file at the grub screen by pressing "e"
where you have to edit the line given below:
root (hd1,2)
kernel /vmlinuz-2.6.18-53.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-53.el5.img
###################################################################################
2:
#vi /etc/grub.conf
default=0
timeout=9
splashimage=(hd0,2)/grub/splash.xpm.gz
hiddenmenu
password --md5 $1$Bw.kp$41Z8tyvP6tTfGXMKajmxy/
title Red Hat Enterprise Linux Server (2.6.18-53.el5)
root (hd0,2)
kernel /vmlinuz-2.6.18-53.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-53.el5.img
title WINDOWSXP
rootnoverify (hd0,0)
chainloader +1
in this file :
just change it to
so the solution:
at the grub screen again you have to press "e" to edit the file.
then again press "e" to edit the line given below:
and then again press "b" to boot the system. and after proper login again do the
changes in /etc/grub.conf file as we did in grub screen.
###################################################################################
3:
#vi /etc/grub.conf
title Red Hat Enterprise Linux Server (2.6.18-53.el5)
root (hd0,2)
kernel /vmlinuz-2.6.18-53.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-53.el5.img
here you see the spelling of /vmlinuz is /vmlinuzz so bcoz of which your O.S.cant
boot
so you have to go in grub screen and press "e" to edit the file
and just edit it to from /vmlinuzz to /vmlinuz then press "b" to boot the O.S.
and after booting edit the /etc/grub.conf file and do the changes which we did at
the grub screen.
###################################################################################
4:
cd /boot
initrd-2.6.18-53.el5.img
just change the name of this file is
#mv initrd-2.6.18-53.el5.img initrd-2.6.18-53.el5.img.corrupt
initrd-2.6.18-53.el5.img
just add corrupt ahead of this line
initrd-2.6.18-53.el5.img.corrupt
and then press "b" to boot the system.
and after booting go to
#cd /boot
and again make the file normal as
###################################################################################
##
5:
vi /etc/fstab
boot:linux rescue
your machine wil boot from cd in rescue mode next
sh-3.1#cd /mnt/sysimage
sh-3.1#cd /etc
now edit the fstab file by nano editor and remove "root" from "/root" from the
first line in the file
sh-3.1#nano fstab
save the file (important) press ctrl+x then press y to save the file
sh-3.1#reboot
reboot the system and remove the cd from your cdrom ad your system will boot
properly.
###################################################################################
6:
#cd /etc
#mv fstab fstab.corrupt
by doing this also your system will not boot so the solution:
boot:linux rescue
your machine wil boot from cd in rescue mode next
sh-3.1#fdisk -l
now you will see the total no of partitions in your system
sh-3.1#df -h
here you will see that no partitons are mounted under /mnt/sysimage,so mount it
manually
sh-3.1#mkdir /mnt/sysimage
sh-3.1#e2label /dev/sda2
to check which is your "/" partition
sh-3.1#mount /dev/sda2 /mnt/sysimage
sh-3.1#cd /mnt/sysimage
sh-3.1#cd etc
sh-3.1#ls
check for your fstab file its name is being changed so make it normal
sh-3.1#mv fstab.corrupt fstab
and then just check the file for confirmationa and reboot
sh-3.1#reboot
7:
# vi /etc/inittab
now in this file we specify our run level through wich we have to boot the O.S
and make it as
id::initdefault:
sh-3.1#
id::initdefault:
there is no runlevel specified so we go in insert mode and put the value of the
runlevel through
which we have to boot the system ,so make it like this:
id:5:initdefault:
and then save the file and reboot the system it will work fine.
###################################################################################
###############
8:
#vi /etc/inittab
# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 6
l3:3:wait:/etc/rc.d/rc 6
l4:4:wait:/etc/rc.d/rc 6
l5:5:wait:/etc/rc.d/rc 6
l6:6:wait:/etc/rc.d/rc 6
sh-3.1#vi /etc/inittab
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 6
l3:3:wait:/etc/rc.d/rc 6
l4:4:wait:/etc/rc.d/rc 6
l5:5:wait:/etc/rc.d/rc 6
l6:6:wait:/etc/rc.d/rc 6
as all values set to "6" so we change the values as per the run levels:
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
and then save the file and reboot the system.it works fine.
###################################################################################
################
#vi /etc/grub.conf
boot:linux rescue
your machine wil boot from cd in rescue mode next
sh-3.1#
at this prompt you have to give the following command.
sh-3.1#chroot /mnt/sysimage
sh-3.1#vi /etc/grub.conf
default=0
timeout=9
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
password --md5 $1$g2kNq$OILDgjY1gBNAhU9PKtivu0
title Red Hat Enterprise Linux Server (2.6.18-53.el5)
root (hd0,4)
kernel /vmlinuz-2.6.18-53.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-53.el5.img
title WINDOWSXP
rootnoverify (hd0,0)
chainloader +1
here we found that the grub password is set so we remove the password line and the
file will look
like this:
default=0
timeout=9
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-53.el5)
root (hd0,4)
kernel /vmlinuz-2.6.18-53.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-53.el5.img
title WINDOWSXP
rootnoverify (hd0,0)
chainloader +1
sh-3.1#passwd
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
sh-3.1#
so now i have removed the grub password and also reset my new root password.
then exit and reboot the system and remove the cd from cdrom.
###################################################################################
################