20 September, 2013

Rescue Mode in Linux


Rescue mode allows you to boot a small Linux environment entirely from a diskette, CD- ROM, or use another method.

However, there may be times when you cannot get Linux running completely enough to access files on the hard drive of your system. Rescue mode, you can access files stored on the hard drive of your machine's files, even if you cannot run Linux from that hard drive.

In general, you have to go into rescue mode for one of two reasons:

     You are unable to boot Linux.

     You encounter hardware or software problems, and want to recover some important files off the hard drive of your system.

Linux Rescue and Single User Troubleshooting

# if you find kernel panic error due to an incorrect configuration, follow the steps below.
If any configuration error occurs on the grub.conf file then boot in single user mode.

How to start a single user mode
Press "E" for editing in the first GRUB screen after POST.

Changes to the boot line
Put "single" in spite of "RO"

Press "B" to boot the system that will move you in the Root shell, update the configuration file with the appropriate options and reboot the machine or start another init.

If the error in /etc/fstab error will be
Type Control+d to continue...

To resolve this error using the linux rescue boot CD first
After booting and initiating rescue command we need to mount hdd in any test directory.

# chroot /mnt/sysimage

Knowing the label mount

#e2lable /dev/hda2  (of hda of root partition. Let say it is 2.
#mkdir test
#mount /dev/hda2 test
then edit the file which ever you require in default state.
# vi test/etc/fstab
# vi test/etc/passwd  Extra first put directory name before path.

How to know in which run level you are:

#run level
#tty  (To find out in which terminal you are)

No comments:

Post a Comment