bad /etc/fstab How can I save changes during fix file system FEDORA
Linux - DistributionsThis forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on...
Note: An (*) indicates there is no official participation from that distribution here at LQ.
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.
bad /etc/fstab How can I save changes during fix file system FEDORA
I modified /etc/fstab and now my system will not boot. When I boot, I get an error during file system check. During boot, when I get the error, I have the opportinity to get to root to fix the filesystem.
When I try to fix the problem by editing /etc/fstab, when I try to save changes (:w!) to /etc/fstab e212 can't open file for writing. Any suggestions for how I can save the needed changes?
Thanks,
John
Burn the cd and boot off it. Login as root and navigate to your fedora partition mount point(/mnt/device_name_for_fedora_partition). Locate your fedora fstab and edit with kwrite. Livecds are the easiest way to deal with this type of problem.
The fedora disk 1 in rescue mode should work just as well.
Should be fixable from the prompt you get at error however - you probably just need to remount the root rw.
I tried to use a live CD with the idea of modifying /etc/fstab. When I tried to mount my hard drive, mount /dev/sda, I get the message that SDA does not appear if /etc/fstab. It appears that the live CD uses its own version of /etc/fstab, and the version used does not recognize my hard drive. I hope you can help me . . .
Thanks,
John
You would need to mount it to some directory (you can use an existing one such as /mnt or create one for that purpose.
So, instead of just: mount /dev/sda1
(just /dev/sda is probably a typo and would likely not work anyway - you need to give the number --> /dev/sda1 for example)
you would type: mount /dev/sda1 /mnt
Also check that the filesystem itself is mounted in read/write mode - the reason for not being able to save your changes could be that the filesystem is mounted read-only.
If that is the case use a command like that to remount a read-only partition as read-write: mount -o remount,rw /
To change the installed /etc/fstab you must first have that as the only /etc/fstab in your path. That involves mounting /dev/sda? (where ? is your root partition number) on mnt in the system presented by the install disc repair function, changing the root point to the mounted root partition, and then editing the /etc/fstab in the new root path. You will also need an edit routine so mounting other partitions in a similar manner BEFORE the chroot may be necessary.
In any event, the process is :
% mount /dev/sda? mnt [so there is no mistake where it is mounted you leave off the /]
[mount whatever else you will need for editing below mnt/ ie. mount /dev/sdc9 mnt/usr, or whatever your needs are]
% cd mnt
% ls -aFC [to check you have the correct discs and partitions mounted under mnt do a few ls of what you think you mounted]
% chroot .
% cp etc/fstab etc/fstab.orig
% [edit] etc/fstab [of course saving your changes]
% reboot [or exit or whatever it takes to get back to booting the installed system]
Provided that you have made the correct changes to fstab, you will then be able to access a properly mounted installation when booting the installed disc.
While editing fstab pay special attention to spelling and correct paths.
Last edited by jbb@vcn.com; 08-11-2008 at 11:50 AM.
You would need to mount it to some directory (you can use an existing one such as /mnt or create one for that purpose.
So, instead of just: mount /dev/sda1
(just /dev/sda is probably a typo and would likely not work anyway - you need to give the number --> /dev/sda1 for example)
you would type: mount /dev/sda1 /mnt
Also check that the filesystem itself is mounted in read/write mode - the reason for not being able to save your changes could be that the filesystem is mounted read-only.
If that is the case use a command like that to remount a read-only partition as read-write: mount -o remount,rw /
My own experience:
Saved by the forum 4sure.
Fedora 9 starts with an error, exits the boot process and tells u to enter root password.
Tried to edit /etc/fstab with "vi" but I was on readonly mode.
After hours of Ctrl+T and Ctrl+v on my Google Chrome, I realised that i need to
Apologies for bring up an old thread but just wanted to thank this man...
Quote:
Originally Posted by jomen
If that is the case use a command like that to remount a read-only partition as read-write: mount -o remount,rw /
Being a noobie and stupidly labelled one of my partitions wrong I was stuck at 'an error occurred during file system check'
Banging my head trying to edit fstab
Middle of downloading SLAX on my poor 512kb connection 1hr 10mins, didn't realise that there were such updates that needed newer 2.6 live cd, like mounting LVM partions.
Also everyone is saying to download a livecd to edit fstab in the posts I read.. WHY!! Above is such a simple command..
Well thanks mate, seems simple BUT It took me ages to find this post. Hope it helps someone else...
I wanted to express my gratitude as I know this is a bit dated, but I found the above to solve my issue I was having due to some labels specified in the fstab file but was unable to write them. I had no idea that / was not mounted up already, and I spent about an hour before I found this and it worked like a Charm..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.