Fedora Linux Support Community & Resources Center
  #1  
Old 11th January 2007, 04:18 PM
worldttle Offline
Registered User
 
Join Date: Apr 2006
Posts: 24
Can't edit fstab as it's a read only file

I had to remove one of my harddisks because it crashed. Now when I boot I get kicked to bash when the system cannot find the removed harddisk and won't proceed any further.

I have tried repeatedly to edit fstab using the vi editor to remove the line that references the harddisk which has been removed. However I always get the message that fstab is a read only file.

However chmod shows I have read/write permission for fstab. What am I missing here?

Thanks.
Reply With Quote
  #2  
Old 11th January 2007, 04:20 PM
leigh123linux
Guest
 
Posts: n/a
Quote:
Originally Posted by worldttle
I had to remove one of my harddisks because it crashed. Now when I boot I get kicked to bash when the system cannot find the removed harddisk and won't proceed any further.

I have tried repeatedly to edit fstab using the vi editor to remove the line that references the harddisk which has been removed. However I always get the message that fstab is a read only file.

However chmod shows I have read/write permission for fstab. What am I missing here?

Thanks.
You need root permission to edit this file

Quote:
su -
gedit /etc/fstab

or for kde

Quote:
su -
kwrite /etc/fstab
try nano for editing

Last edited by leigh123linux; 11th January 2007 at 04:28 PM.
Reply With Quote
  #3  
Old 11th January 2007, 05:25 PM
worldttle Offline
Registered User
 
Join Date: Apr 2006
Posts: 24
Thank you for your suggestion, but after using su - , nano nor vi still not allow me to edit fstab.

Nano gives the message: [ Error writing fstab: Read-only file system ].

John
Reply With Quote
  #4  
Old 11th January 2007, 05:34 PM
srs Offline
Registered User
 
Join Date: Dec 2006
Posts: 59
Try to edit fstab after booting to failsafe mode.
Reply With Quote
  #5  
Old 11th January 2007, 05:35 PM
Seve Offline
Retired Community Manager
 
Join Date: Oct 2004
Location: The GTA, Ontario, Canada
Age: 56
Posts: 12,371
Hello:
After typing
su -
did you enter your root password and then enter and then
type
gedit /etc/fstab

Seve
__________________
Registered Linux User: #384977
.................................................. ............
See the Links below for more Help and those much wanted extras ... :)
Reply With Quote
  #6  
Old 11th January 2007, 05:40 PM
pete_1967 Offline
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 4,315
And if, when you try to save the file (:w) in Vim it tells you file is read-only, add exclamation mark at the end of write command -> ':w!'
Reply With Quote
  #7  
Old 11th January 2007, 05:43 PM
nick.stumpos Offline
Registered User
 
Join Date: Feb 2005
Location: Lansing, Mi
Age: 29
Posts: 2,222
is it immutable try as root chattr -i
__________________
As always
Love, Life, Loyalty, Wisdom, Knowledge, And Understanding
FC6: Common Questions answered
Reply With Quote
  #8  
Old 11th January 2007, 05:44 PM
worldttle Offline
Registered User
 
Join Date: Apr 2006
Posts: 24
When the boot process aborts upon failing to find the removed harddisk, it asks for a password before dropping into bash. At this point I enter my root password before (I assume) entering bash.

When I type su -, it does not ask for a password. I just get the prompt line again. I would guess su see that I'm already logged in as root?

How do I boot into failsafe mode?

Thanks.
Reply With Quote
  #9  
Old 11th January 2007, 05:46 PM
worldttle Offline
Registered User
 
Join Date: Apr 2006
Posts: 24
Nope, :w! doesn't do it.

Thanks.
Reply With Quote
  #10  
Old 11th January 2007, 05:51 PM
pete_1967 Offline
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 4,315
You are doing something seriously wrong now.

do `ls -l /etc/fstab`in console and post the result here. Also do `whoami` in console and post the result here (when you are logged in as root).
Reply With Quote
  #11  
Old 11th January 2007, 05:59 PM
srs Offline
Registered User
 
Join Date: Dec 2006
Posts: 59
I should rather called failsafe for runlevel 1 (single-user mode)... Anyway, boot into single-user mode and try the following taken from http://www.unixguide.net/linux/faq/04.15.shtml:
Code:
Root File System Is Read-Only
Remount it. If /etc/fstab is correct, you can simply type:

mount -n -o remount /

If /etc/fstab is wrong, you must give the device name and possibly the
type, too: e.g.

mount -n -o remount -t ext2 /dev/hda2 /

To understand how you got into this state, see, ("EXT2-fs: warning:
mounting unchecked file system.")
Reply With Quote
  #12  
Old 11th January 2007, 06:01 PM
worldttle Offline
Registered User
 
Join Date: Apr 2006
Posts: 24
ls -l /etc/ftab returns -rw-r--r-- 1 root root 729 Oct19 2237 /etc/fstab

whoami returns root

By the way, when the boot process stops, it asks for the root password to continue or Ctr-D to reboot. I enter the root password at this point and get the '(Repair filesystem) 1 #' prompt.

Thanks.
Reply With Quote
  #13  
Old 11th January 2007, 06:13 PM
worldttle Offline
Registered User
 
Join Date: Apr 2006
Posts: 24
Bingo! srs is correct.

mount -n -o remount / allowed fstab to be edited.

Thanks to everyone.
Reply With Quote
  #14  
Old 17th January 2007, 03:55 AM
fnmblot Offline
Registered User
 
Join Date: Feb 2005
Location: Atlanta, GA
Posts: 300
Thanks a million for this post! I was almost ready to reinstall FC6.
fnmblot
__________________
Gee Ricky, I'm sorry your mom blew up.
Reply With Quote
  #15  
Old 17th January 2007, 11:08 AM
Jongi Offline
Registered User
 
Join Date: Oct 2005
Posts: 1,952
Great stuff srs. I once *****ed about why in that state you couldn't get write access instead you had to boot from the rescue disk. This will prove very valuable I am sure.
__________________
Desktop (64-bit) - F12, Debian Sid, OpenSUSE 11.2, ArchLinux
Reply With Quote
Reply

Tags
edit, file, fstab, read

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting a FAT32 drive and edit the fstab file and what all means zellis Guides & Solutions (No Questions) 30 4th December 2007 10:59 AM
how to edit /etc/fstab, it is read-only walterstern Using Fedora 7 6th April 2007 01:38 PM
Fstab corrupted. Read-only file system KarateCowboy Using Fedora 10 17th February 2006 03:16 AM
Edit Read-Only File dnlawyer Using Fedora 2 21st January 2006 11:27 AM
i can't edit a file! pico / edit bad commands? virtuoso Using Fedora 8 9th November 2004 08:45 PM


Current GMT-time: 05:41 (Thursday, 18-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat