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.
Hi,
I'm using Fedora 8.
I put an incorrect entry in /etc/fstab, and when I reboot, I get the options of reboot or shell. I tried to edit fstab, but it won't let me save because the "file system is read only".
Being a newbie, can anyone give me step instructions on what to do.
now hit esc and then press :x and hit enter(this will save your file)
..
Thanks for the quick reply,
The machine is at work, so I can't try it immediately, but, I tried editing it with MC. When I go to save it says it's READ ONLY. I tried CHMOD but I get the "File system is READ ONLY" message.
if you login as root, you will have write permissions to the fstab file...
but use vi (vim now but vi works too)
i dont use mc for editing so cant help you there...
Well, reddazz used the phrase "you can also," which is true (although "can also" is misleading), but misses the point that you can not edit fies on a read-only file system. (You must, however, have a read-only file system if you want to fix partition table errors.)
Thus your only option is to use a Live CD or, if you have your Fedora installation media, you can boot from it and, at the first prompt, type "linux rescue" to boot into rescue mode. Follow the instruction to chroot /mnt/sysroot, and change /etc/fstab as needed. Note that you will need a "Live CD" that supports the lvm command if you choose that route.
There's actually few other options but they require that you have other operating systems installed that can mount the Fedora Logical Volume(s) and edit files on them, or that you physically move the drive to another such system.
Aside: You can check your fstab entries before using them by opening a terminal window after you save your changes and then issuing a mount /... (where the "..." is the new mount point you just defined).
Also, there are several options beside LABEL= that you can use to make your fstab entries more robust. When you get your system working again, look at the subdirectories under /dev/disk for what you can put in UUID=, PATH=, or ID=. For even more flexibility, look at man udev.
I had a similar problem, but after having entered the command
# mount -n -o remount,rw /
I could edit and writing /etc/fstab. After editing, just type CTRL+D, and your machine will reboot.
But if you aren't during booting, then you can mount your Fedora partition from an other Linux partition, (if you have one, and Fedora partition isn't mounted yet,) and edit /etc/fstab. In this case your command:
# mount /dev/hdx /mnt/mount_point
# vi /mnt/mount_point/etc/fstab
hdx (e.g. hda3, hdb2 etc.) may be sdx, if you have SATA disk, and
/mnt/mount_point may be any directory, without any content.
I had a similar problem, but after having entered the command
# mount -n -o remount,rw /
I could edit and writing /etc/fstab. After editing, just type CTRL+D, and your machine will reboot.
But if you aren't during booting, then you can mount your Fedora partition from an other Linux partition, (if you have one, and Fedora partition isn't mounted yet,) and edit /etc/fstab. In this case your command:
# mount /dev/hdx /mnt/mount_point
# vi /mnt/mount_point/etc/fstab
hdx (e.g. hda3, hdb2 etc.) may be sdx, if you have SATA disk, and
/mnt/mount_point may be any directory, without any content.
WARNING: The above commands in red are not appropriate if you are using the default Fedora 8 Logical Volume installation.
And, in any case, Fedora no longer uses the obsolete hd device descriptors (although you can force them by defining then as symbolic links in udev). By default, in Fedora 8 all hard drives, regardless of their physical characteristics, are in the form /dev/sd?.
<edit> Second Warning: Logical Volumes are, generally, found the /dev in the following format: /dev/<Volume Group Name>/<Volume Name>. This is not a warning for Wambat, but for anyone who needs to run fsck on a logical volume inside a volume group: Running fsck on the physical device (e.g., /dev/sda) containing a volume group will destroy the volume group.
</edit>
Last edited by PTrenholme; 01-23-2008 at 09:25 AM.
But if someone get a prompt during booting, because of an error, and can't write the modification out because of a read-only message, then remounting the filesystem as read-write with the first command will help them.
This helped me at least.
Thus your only option is to use a Live CD or, if you have your Fedora installation media, you can boot from it and, at the first prompt, type "linux rescue" to boot into rescue mode. Follow the instruction to chroot /mnt/sysroot, and change /etc/fstab as needed. Note that you will need a "Live CD" that supports the lvm command if you choose that route.
Thankyou for the most useful reply. Yes, my main problem was that it was read only, and using rescue from the install media helped with that. Still had to use VI, but managed to get it first go :-)
-n Mount without writing in /etc/mtab. This is necessary for example when
/etc is on a read-only file system.
-o Options are specified with a -o flag followed by a comma separated
string of options.
The "/" at the end of the command specifies the "root" file system. The "rw" means, of course, "read/write," and "remount" is, I hope, obvious.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.