Home » » Error occured during file system check – fsck in RHEL 5

Error occured during file system check – fsck in RHEL 5

Written By 1 on Saturday, August 27, 2011 | 11:15 PM

I was working on file system creation on a couple of Linux Servers. While rebooting the server, I received an error message while mounting the /var partition.

If one has the root password for the server, it becomes very easy to get rid of this problem, but unfortunately I didn’t had root password for the server.
I tried to boot the server into single user mode, but did got the same error message as the kernel loads init after mounting the file system(s) in Read/Write Mode.
I still had an option to boot the server into Linux Rescue Mode to fix the problem, but it really takes lots of time specifically if the server is located at remote location. I did little search and found one very good kernel boot option to skip init as well as authentication and drops you at the root prompt.
The grub prompt allows you to provide additional kernel parameters (boot options) at the grub command prompt to boot the server with specific parameters without changing the parameters in grub.conf file.
I tried to put together all the steps with screen shots so it might help someone :
1. At the Grub Prompt, press “a” to provide additional kernel parameters.
2. Add “init=/bin/bash” at the end and press “Enter”. Basically, we are just telling the kernel to load /bin/bash in place of init to skip init process and get the root prompt.

3. The kernel will drop you to a root shell.

4. Execute the following command @ the bash prompt to mount the root partition in read/write mode.
bash-3.1# mount -o remount,rw /
Now you can troubleshoot the actual cause for the error message and can also fix the error. You can update files in root file system and can also execute fsck or any other command on file system(s) other than root to fix the error(s). In my case, /etc/fstab file was incorrect, so I just updated /etc/fstab file. Once the problem(s) are fixed, reboot the server. If you type exit, you would get an error message “Kernel panic – not syncing : Attempted to kill init !”. Ignore the error and hard reboot the server.

0 Comment:

Post a Comment