 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

11th January 2007, 04:18 PM
|
|
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.
|

11th January 2007, 04:20 PM
|
 |
Retired Administrator
|
|
Join Date: Oct 2006
Posts: 21,509

|
|
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
or for kde
try nano for editing
__________________
My Hardware
- CPU: AMD Phenom II X6 Hex Core 1055T 95W Edition @3.5Ghz
- Motherboard: Gigabyte GA-880GM-UD2H
- Cooler: Corsair H50 CPU Cooler
- RAM: Corsair Dominator 8GB (4x2GB) DDR3 1600MHz
- Graphics: Gigabyte GeForce GTS 450 OC 1024MB GDDR5
Last edited by leigh123linux; 11th January 2007 at 04:28 PM.
|

11th January 2007, 05:25 PM
|
|
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
|

11th January 2007, 05:34 PM
|
|
Registered User
|
|
Join Date: Dec 2006
Posts: 59

|
|
|
Try to edit fstab after booting to failsafe mode.
|

11th January 2007, 05:35 PM
|
 |
Retired Community Manager
|
|
Join Date: Oct 2004
Location: The GTA, Ontario, Canada
Age: 54
Posts: 12,376

|
|
|
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 ... :)
|

11th January 2007, 05:40 PM
|
|
Clueless in a Cuckooland
|
|
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,929

|
|
|
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!'
|

11th January 2007, 05:43 PM
|
 |
Registered User
|
|
Join Date: Feb 2005
Location: Lansing, Mi
Age: 28
Posts: 2,222

|
|
|
is it immutable try as root chattr -i
|

11th January 2007, 05:44 PM
|
|
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.
|

11th January 2007, 05:46 PM
|
|
Registered User
|
|
Join Date: Apr 2006
Posts: 24

|
|
|
Nope, :w! doesn't do it.
Thanks.
|

11th January 2007, 05:51 PM
|
|
Clueless in a Cuckooland
|
|
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,929

|
|
|
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).
|

11th January 2007, 05:59 PM
|
|
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.")
|

11th January 2007, 06:01 PM
|
|
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.
|

11th January 2007, 06:13 PM
|
|
Registered User
|
|
Join Date: Apr 2006
Posts: 24

|
|
|
Bingo! srs is correct.
mount -n -o remount / allowed fstab to be edited.
Thanks to everyone.
|

17th January 2007, 03:55 AM
|
|
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.
|

17th January 2007, 11:08 AM
|
|
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 15:06 (Friday, 24-05-2013)
|
|
 |
 |
 |
 |
|
|