LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   My fstab is readonly, and I can't change it! (https://www.linuxquestions.org/questions/linux-software-2/my-fstab-is-readonly-and-i-cant-change-it-568604/)

pmw 07-11-2007 10:56 PM

My fstab is readonly, and I can't change it!
 
Can someone help? My /etc/fstab file is readonly, and there's seemingly nothing I can do to change it - chmod doesn't work, remounting doesn't work, rebooting doesn't work. When I edit in vi, it says:

"/etc/fstab" [readonly] 9L, 695C

I can't replace it, either. I am working as a root (via su -). I'm running Fedora Core 6.

Thanks.

Kahless 07-11-2007 11:04 PM

are you SURE that you are running as root? is there a # or a $ next to your command prompt?

pmw 07-11-2007 11:09 PM

Yep, sure I'm running as root. There's a # as my command prompt.

Junior Hacker 07-11-2007 11:19 PM

Have you tried using vim from a super user terminal or edit it from a super user file manager. That is, if you have those features, you should if you have KDE, Gnome is a strange area for me.

Kahless 07-11-2007 11:29 PM

very strange.


is it possible that it is on a read only file system? if so you would need to remount that file system as read only.



alternatively, i know this is very sub-ideal, but can you boot up to a live distro and edit it that way?

pmw 07-12-2007 12:04 AM

All good ideas, but none of them worked. Using vim from a super-user terminal just gave me the same result (not being able to save the edited file). Using the super-user file manager gave me an "Access denied" message whenever I tried to change the fstab file (I noticed that the permissions are definitely set to read and write for the owner, who is root).

I remounted the filesystem as read-write, but to no avail. I'm not sure how to tell if the filesystem is read-only, so if you have info on that, I can check.

And I don't know how to boot from a live distribution - further info would be useful.

Thanks.

Junior Hacker 07-12-2007 12:15 AM

Go here, pick the option you prefer and put it over top of Fedora to fix the problem. :p

jonwatson 07-12-2007 12:27 AM

Any chance the immutable flag is set?

chattr -i /etc/fstab

pmw 07-12-2007 12:35 AM

Jonwatson, you are a god :)

I have no idea what the immutable flag is, but that was the problem. Thank you very much!

jonwatson 07-12-2007 12:45 AM

Quote:

Originally Posted by pmw
Jonwatson, you are a god :)

I have no idea what the immutable flag is, but that was the problem. Thank you very much!

Glad I could help.

I've always found that if root cannot do something to a file, it is almost always one of two things:

1. The file system is mounted read only (which someone else mentioned in this thread), or
2. The immutable flag is set

I must admit to having no idea why the immutable flag seems to get set now and again, but it does.


All times are GMT -5. The time now is 02:18 AM.