Friday, October 10, 2014

Booting into Rescue Mode and fsck the volumes


Booting into Rescue Mode and fsck the volumes

When you boot from cd, you will get an option to go to rescue mode. Please boot off the cd1 of the OS disk. It can be cd/DVD or ISO image. (x86 system).

You will be on prompt and just type linux rescue and press enter.
Follow some information and finally you will be on rescue mode with the shell prompt.
sh-2.05b#

A. Check the mounted filesystem with df -h

1. Get the volume to fsck
# df -h | awk '{print $i} >/tmp/zzz

2. Remove unwanted content and do the fsck.
# vi /tmp/zzz

3. If you get complain that mounted fs can not be fsck, unmount sysimage.
# mount | grep sysimage | awk '{print $3}' |sort -r | awk '{print "umount " $0}' |sh

4. Run fsck on volume.
# for i in `cat /tmp/zzz`; do fsck -y $i; done
or
# for i in `cat /tmp/zzz`; do e2fsck -y $i; done

B. Logging to the system disk.

1. Now mount the OS with chroot command
# chroot /mnt/sysimage

2. List the mounted fs. You will see all mounted from /etc/fstab
# df -h
3. If needed do the fsck.

No comments:

Post a Comment