tags:

views:

1244

answers:

2

I had a typo in my fstab and it boots to a commandline but is readonly, I know what the error is but i can't change it because it's mounted as readonly. I want to mount the filesystem and make the changes. I know I can boot a live distro and edit it that way, but i was wondering if there was an easier way to do it.

It's debian lenny by the way.

+9  A: 

Yes, if you end up in single-user mode with a readonly root, try:

mount / -o remount,rw

Maybe a -n is necessary, maybe not. That should remount the root fs read/write (assuming there's nothing wrong with it).

Peace!

MarkR
A year and half later, you just saved my ass.Thanks.
Milan Ramaiya
A: 

My kernel command line looks like this:

$ cat /proc/cmdline
root=/dev/sda4 ro
$

Tell grub that it should omit passing "ro" to the kernel when booting (pressing esc, e on the entry you want edit will allow you to edit the arguments given to the kernel), and it will mount your root file system not read only anymore. Then you can change your /etc/fstab and restart.

Johannes Schaub - litb
it's called grub, not grab.
hop
omg yeah indeed. thanks for telling
Johannes Schaub - litb