About Me

My photo
Hi Friends, I am Sandeep CC and some people know me as System Administrator. I have started my professional career from 2008. I have been working as System Administrator on Linux Server and Windows Client. I am here to share my Knowledge in which I have experienced and which I have come across till now, It could be help to you people. In case anything wrong or any improvements in my post steps, Please comment to the post, Feel free to contact me by posting comments on this blog. Thanks and Regards, Sandeep CC

Thursday, December 29, 2011

Edit FSTAB file in Single User Mode in REDHAT LINUX

Today I Faced Problem In My Company, My Linux RHEL5 Server was running suddenly power gone, UPS didn't worked properly, Server got crashed, When I was trying to start it was coming one screen and structuring on the same place, It was asking to give Root Password, When I given it was showing like System Repair.

I had tried with fsck -r & e2fsck -r /home command for checking and recovering/repairing corrupted files (e2fsck -r /home will warn you to fix it corrupted file, we can recover superblock files also). but it was showing error in /home drive, then later i reminded that i had mounted one directory in /home. checked error was getting in /home only with where i had mounted the one directory. When System got crashed that time /home directory had got unmounted and directory size was showing with 0 size, it was showing like total files 0. fsck & e2fsck commands also not recovered corrupted/superblock files.

Later thought to edit /etc/fstab file because system was getting problem with mounted directory in /home/xxx, I entered in single user mode by giving init 1 run level, but here i could not edit file, i was entering in file by vi editor but couldn't saved it, it was getting error read only permission, then i had done remounting /etc directory for getting permission to edit and save /etc/fstab file.

#mount -o remount,rw /etc

Now i can edit /etc/fstab file in single user mode, deleted mounted /home/xxx directory line from fstab file and restarted (init 6), Finally Server got up and started working fine....

Thanks & Regards,
Sandeep CC