Home > CentOS, Linux, Oracle Linux, Red Hat > Red Hat: How to check and repair your root-filesystem in rescue mode

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

Problem description:

Your Linux server had some troubles with it’s underlying storage devices and put all your filesystems into read only mode. You corrected the issue and are booting up your Linux server. The boot process determines some problems with your root filesystems and requires a manual intervention by logging in with the root password. Unfortunately your are unable to login because the root password is not accepted (although you are using the correct one for the 25th time ;-) ).

You are unable to boot because of filesystem issues. At the same time your are unable to fix the filesystem, because your root password is not accepted.

 
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.

 

Categories: CentOS, Linux, Oracle Linux, Red Hat Tags:
  1. No comments yet.
  1. No trackbacks yet.

Connect with Facebook