Cannot edit fstab in recovery mode. Filesystem is read only
I need to edit fstab so I can remove an invalid line. I can see the file with VI but when I try to save the change I get a file system read only message. I have tried to use w! to overcome this, with no luck.
I think I need to make the file system writable and have tried to with no luck..any help would be good.:rolleyes: I am loged in as root. When I try to run fsck i get an error that reads "the superblock could not be read" It refers to the line in fstab that i am trying to delete. I must change the filesystem to writable so I can edit fstab, I think. I know recovery mode puts the file system in recovery mode by default, is it possible to change this.. |
If you can't boot into your system and login as root to edit fstab, you might want to boot from a "live cd" like ubuntu's or maybe your installation disk and mount the root partition and then edit fstab.
|
If your root filesystem is mounted read-only, one possibility is that the filesystem is corrupt. It may simply be marked unclean. You could check it with fsck.
|
Recovery mode puts your filesystem in read-only mode by default.
|
Cannot edit fstab in recovery mode
How do i make the filesystem writable
|
From a live CD or in rescue with the distro CD, I wonder if you can unmount and re-mount in read write, assuming from a live CD the drive may be /mnt/sda1
umount /mnt/sda1 This will probably give an error if it is not mounted but that's OK. Then try mounting in read write: mount -o rw /dev/sda1 /mnt/sda1 Not sure if it will work, but that's how to do it with the Helix CD for changing an NT password, or whatever. Then it may be necessary to change permissions for /etc/fstab. |
No need to unmount it just add "-o remount" to the mount command Junior Hacker offered.
|
No need for a recovery cd. Boot into your system by passing init=/bin/bash at the kernel grub menu by editing the boot parameter.
Upon bootup, do these steps: mount /proc mount / If /etc resides in /, then it should be read/write and you can edit fstab. You may need to mount /tmp and /var as well to reboot so it doesn't complain. |
Alternative method
I know this thread is old, but I thought I would offer a simpler solution:
mount -o remount,rw / |
Quote:
Thank you. Regards, Airell. |
Quote:
|
mount -o remount,rw / is not working for me.4
It says Unrecognized mount option "realtime.acl.errors=remount-ro". I edited that line by mistake. How do i remove it?? |
If you are failing the initial disk checks, you may be able to just bypass them using fastboot.
I removed a Logical Volume from a machine and forgot to remove it from fstab before rebooting. File system checks were failing and would not allow me to boot into the OS, except for recovery mode. I needed to remove an old entry from fstab: /dev/VolGroup01/LogVol02 /data ext3 defaults 1 2 During the grub boot process, i threw in the "fastboot" flag. This skipped the disk checks and booted me into the server. From there, I was able to SSH in, remove my entry from fstab and I'm all set. If entirely unfamiliar with grub: hit any key on the grub screen to display the menu highlight your kernel and hit the e button to edit just add "fast boot" (no quotes) to the end of the line. hit enter to save and b to boot. Might help someone in a similar situation. |
Thanks
|
Quote:
|
All times are GMT -5. The time now is 12:22 AM. |