martedì 26 novembre 2013

Red Hat: How to check and repair your root-filesystem in rescue mode

Problem resolution:

Take a Linux installation media of your distribution and boot into linux rescue mode by typing the following command when asked for boot options:
linux rescue

Select your language and keyboard layout:

Network configuration is not necessary and can be skipped:

A very important step is to SKIP the mount of your Linux installation. Do not use MOUNT or READ-ONLY. For a filesystem check it is required that the filesystem is unmounted. Once mounted it is nearly unpossible to unmount your root-filesystem in rescue mode.

If you are not using a Logical Volume Manager for your filesystems you can directly jump to execute the “fsck” command. Otherwise you will have to first scan for your Physical Volumes and review them:
lvm pvscan
lvm pvdisplay

If your Physical Volumes were listed correctly continue to review the detected Volume Groups:
lvm vgdisplay

Now continue to activate your Volume Groups in order to create your Logical Volume devices in the “/dev” filesystem. In this example a Volume Group with the name “VolGroup00″ has to be activated:
lvm vgchange -a y VolGroup00

After activating your Volume Group(s), you will be able to perform a filesystem check and correct problems:
fsck /dev/VolGroup00/LogVol00

Once the filesystem check finishes successfully, you should be able to reboot without any further complication.

Nessun commento: