Wednesday, June 30, 2010

How to edit a read-only /etc/fstab during single-mode on CentOS

If somehow like me, you edited the /etc/fstab wrongly and have to enter the maintenance mode to rescue it but was not able to edit it.

For this blog entry, I'm writing on using a Linux CD to do a rescue.

Step 1: Put in the CentOS 5.4 CD and boot to CD

Step 2: Press F5 and type linux rescue at the boot prompt
linux rescue

Step 3: When given the command prompt again after a series of screen
# vi /mnt/sysimage/etc/fstab
Do the necessary changes to /etc/fstab
Step 4: Do the reboot
# reboot


Gutherzig said...

simply remount your root partition using this command :
mount -n -o remount /
then it's now editable :)

Unknown said...

Thanks "mount -n -o remount /" saved me a lot of time!

kittycool said...

Wow! Thanks for the tips!

Anonymous said...

You really loaded your blog with quality material. Indeed, lots of great information and inspiration, both of which we all need.