Cannot edit fstab in recovery mode. Filesystem is read only
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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. 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..
Last edited by james7775; 03-24-2007 at 11:17 AM.
Click here to see the post LQ members have rated as the most helpful post in this thread.
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.
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.
Last edited by Junior Hacker; 03-24-2007 at 11:55 PM.
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.
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.
If you are failing the initial disk checks, you may be able to just bypass them using fastboot.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.