LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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

Reply
 
Search this Thread
Old 03-24-2007, 10:27 AM   #1
james7775
LQ Newbie
 
Registered: Mar 2007
Posts: 2

Rep: Reputation: 0
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.
Old 03-24-2007, 11:03 AM   #2
jim_fields
Member
 
Registered: Nov 2006
Distribution: Slackware 11.0, Debian Lenny, testing
Posts: 32

Rep: Reputation: 16
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.
 
Old 03-24-2007, 11:07 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
Old 03-24-2007, 11:15 AM   #4
jim_fields
Member
 
Registered: Nov 2006
Distribution: Slackware 11.0, Debian Lenny, testing
Posts: 32

Rep: Reputation: 16
Recovery mode puts your filesystem in read-only mode by default.
 
Old 03-24-2007, 07:36 PM   #5
james7775
LQ Newbie
 
Registered: Mar 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Cannot edit fstab in recovery mode

How do i make the filesystem writable
 
Old 03-24-2007, 11:52 PM   #6
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
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.
 
Old 03-24-2007, 11:58 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,224

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
No need to unmount it just add "-o remount" to the mount command Junior Hacker offered.
 
Old 03-25-2007, 09:03 AM   #8
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
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.
 
Old 08-27-2010, 02:19 PM   #9
solarisguy
Member
 
Registered: Aug 2010
Location: Seattle
Distribution: CentOS, RHEL, Oracle Enterprise Linux, Solaris, BSD
Posts: 35

Rep: Reputation: 10
Alternative method

I know this thread is old, but I thought I would offer a simpler solution:

mount -o remount,rw /
 
5 members found this post helpful.
Old 12-29-2011, 01:55 AM   #10
Airell
LQ Newbie
 
Registered: Dec 2011
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by solarisguy View Post
I know this thread is old, but I thought I would offer a simpler solution:

mount -o remount,rw /
Old thread or not, this command helped me, even more than a year after your answer!
Thank you.

Regards, Airell.
 
Old 12-30-2011, 12:49 AM   #11
solarisguy
Member
 
Registered: Aug 2010
Location: Seattle
Distribution: CentOS, RHEL, Oracle Enterprise Linux, Solaris, BSD
Posts: 35

Rep: Reputation: 10
Quote:
Old thread or not, this command helped me, even more than a year after your answer!
Thank you.

Regards, Airell.
Glad it helped you out! Pretty simple stuff once you're familiar with it.
 
Old 01-30-2012, 01:47 AM   #12
GNakul
Member
 
Registered: Oct 2011
Location: Bangalore,India
Posts: 59

Rep: Reputation: Disabled
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??
 
Old 01-31-2012, 03:06 PM   #13
tek3
LQ Newbie
 
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 02-29-2012, 06:27 PM   #14
h.marsman
LQ Newbie
 
Registered: Feb 2012
Posts: 2

Rep: Reputation: Disabled
Thanks

Last edited by h.marsman; 02-29-2012 at 06:31 PM.
 
Old 02-29-2012, 06:29 PM   #15
h.marsman
LQ Newbie
 
Registered: Feb 2012
Posts: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by tek3 View Post
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.

Might help someone in a similar situation.
Thanks for sharing, it helped me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit "read-only" /etc/fstab from "System Recovery#" (without boot cd?) charlweed Linux - General 1 12-31-2006 05:57 PM
wish to edit but fstab is read only obay Linux - Newbie 3 07-29-2006 03:25 PM
cannot edit fstab in SELinux active mode eldraque Fedora 1 01-19-2006 03:38 AM
How do I change "fstab" to Write/Edit Mode? sharathkv Linux - Newbie 4 07-29-2003 07:52 AM
Mounting root filesystem in read only mode. Ocran Linux - Software 3 07-01-2002 12:38 AM


All times are GMT -5. The time now is 06:53 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration