LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Read-only file system??? (https://www.linuxquestions.org/questions/red-hat-31/read-only-file-system-401978/)

kinetik 01-11-2006 06:27 AM

Read-only file system???
 
I'm trying to recover a root account someone renamed by accident.

I get as far as logging into # and editing /etc/passwd, but when I try to save it, I get the message that the file-system is read-only!

How can I get this little problem sorted out?


ADDED: I tried :wq! already

openbysource 01-11-2006 06:56 AM

Hi,

Issue the following command before editing the /etc/passwd file

mount -o remount, rw X /

in place of X specify the disk label where your Linux system partition resides mine is
/dev/hda5

Now you can edit the file.


Regards
Be Open By Source

kinetik 01-11-2006 07:05 AM

Thanks man, but it still doesn't do anything...


I did a mount -o remount, rw X /dev/sda2

It only gives me information on the mount command itself (this system's a bit messed up).


Any other ideas?

openbysource 01-11-2006 07:07 AM

Hey man u need to grow up

I said replace X with /dev/sda2.

Now issue the following command:


mount -o remount, rw /dev/sda2 /

remember to put the forward slash at the last


man u need to grow up really i m telling u seriously !

kinetik 01-11-2006 07:53 AM

OK, was that sarcasm / trying to be funny and failing miserably / genuine irritation?

I'll refrain from calling you an a-hole since you tried helping me out, and because I didn't read what was on the screen.

Another reason I'll refrain from insulting you is because it still doesn't work and I could use some further assistance, message being:

mount: /dev/sda2 not mounted already, or bad option


<seriously now>
If you could help me out here I'd really appreciate it.
</seriously now>


ADDED: Come on OpenBySource, I didn't mean to offend you here or anything (sorry if I did, unintentional), just really need your help. When I run mount, it lists /dev/sda2 as rw, yet when I try to edit anything it sez read-only filesystem. I'm really stumped here!

openbysource 01-11-2006 09:26 AM

Hey,

It doesn't matter. These kinda talks are common if something is mis-understood.


Well as far as your problems goes can you please tell me which runlevel you are:

This can be easily find out by issuing the command

runlevel


Regards
OpenSource

kinetik 01-11-2006 10:31 AM

That's a relief! I appreciate your help OpenBySource!

Well, I booted up using the GRUB section found here http://linuxgazette.net/107/tomar.html (I know the root password, problem is I just never get the chance to type it in)

When I ran runlevel, here's what I got: N 5


NOTE: I'm using VMWare GSX to do this, don't know if that's of any relevance

wmakowski 01-17-2006 11:04 PM

Interesting that you are in runlevel 5. Did you enter the password for a regular user to get to this point? Are you able to use "su -" or is it messed up because of the rename on the root account?

I'm not certain what effect renaming the root user would cause to a system. Many startup scripts and daemons usually run as root so it may upset the balance of the universe. :) Hopefully the person who renamed root didn't mess with any of the filesystem owners:groups otherwise there could be a real mess to clean up.

The article from linuxgazette is a good reference. I would first try booting up in single user mode. If that didn't work I would go with using a LiveCD to permit mounting of the root partition in rw mode and then edit /etc/passwd. With RedHat I know you can use the install CD's to go into rescue mode and solve the problem similar to using a LiveCD.

Bill

kinetik 01-20-2006 03:40 PM

Hi Wmakowski, thanks for your advice!

No I wasn't able to su, login as root or any of that. Even after repairing the passwd file, problems still didn't want to dissappear.

I've now reinstalled everything from scratch, with one important difference: I now made the VMWare Disk as Undoable. Now if something goes wrong and I can't figure out what the problem was, I simply reboot and say "Discard changes". Presto, system's back online and ready to roll! :)

jackpal 10-30-2007 01:56 PM

I know this thread is old but the problem still exists. The original poster was using GSX server which is a VMware product. I ran into the same problem on my ESX server with RHEL4 Update 4. So far one of the filesystems has gone read only twice now in a 10 days throwing my bugzilla/mysql/splunk installs into a spin. This is now a known and acked problem by VMware as of this post (Oct 30,2007).

The problem is fixed by using the patch instructions provided at the following URL:

http://kb.vmware.com/vmtnkb/search.d...20KB%20Article

Happy VMing :)

mjlush 04-03-2008 05:30 AM

Quote:

Originally Posted by openbysource (Post 2041513)
Hi,

Issue the following command before editing the /etc/passwd file

mount -o remount, rw X /

in place of X specify the disk label where your Linux system partition resides mine is
/dev/hda5

Now you can edit the file.

Regards
Be Open By Source

For the benefit of the next person who googles across this thread

I had a similar problem (read only in single user mode)

I found

mount -o remount, rw /dev/hda2 /

failed

however

mount -o remount, -rw /dev/hda2 /

worked (where /dev/hda2 was my root partition).

topsian 03-13-2009 05:43 AM

mount remount
 
Thanks for this thread I managed to use it after failing to get my head around all the options for mount on the man pages. Please note that it looks that where everyone on this thread has typed or copied...

mount -o remount, rw X /

There is a space between the comma and the rw the comma is to separate option from -o. This will fail saying that you must specify the file type and return 32 (mount failure)

The command should be


mount -o remount,rw X / where X is the filesystem

cheers

saltie 11-17-2011 07:58 AM

Quote:

Originally Posted by mjlush (Post 3109228)
For the benefit of the next person who googles across this thread

I had a similar problem (read only in single user mode)

I found

mount -o remount, rw /dev/hda2 /

failed

however

mount -o remount, -rw /dev/hda2 /

worked (where /dev/hda2 was my root partition).

Thanks for taking the time to tell us this :)

kinetik 11-18-2011 12:52 AM

Not related, but it's quite funny looking back at this thread now over 6 years later and seeing the way I spoke back then ("man", "dude" :D ).

Anyways, this just once again reminds me how great a forum this is.


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