[nzlug] Big Problem... ReiserFS

Daniel Pittman daniel at rimspace.net
Wed Aug 23 12:59:49 NZST 2006


Hadley Rich <nzlug at nice.net.nz> writes:
> On Wednesday 23 August 2006 10:19, Peter Harrison wrote:
>> Problem is I need to run reiserfsck, but I can't do that on a read/write
>> file system. I've been trying to work out how to remount as read only
>> but I just get device busy. I installed Suse 10.1 off the net install,
>> so I don't have a boot CD.
>>
>> Does anyone know how I might fix this?
>
> You could boot with init=/bin/bash appended to your grub/lilo command
> if you want a read only shell, or boot from a CD or Suse may well have
> some sort of recovery mode to do this for you.

This is probably the best bet if you don't have access to any other
recovery media, full stop.  Then you can download some and use that next
time.

Four tricks of note with this:

First, don't exit the shell that was created.  If you do the kernel will
panic (init exited) and you will be sad.


Second, don't actually work in that shell if you can avoid it.  It
doesn't have job control enabled which mean, among other things, no
breaking out of a process using control-C.

Try running 'open /bin/bash' to open a second virtual console (with job
control) and do your work there.  

Otherwise you will get an annoying surprise when, like me, you forget
the first time and end up stuck with a ping running that you can't break
out of...


Third, before you reboot *sync* manually.  This is very important, but
very easy: just run the 'sync' command and wait for disk I/O to stop
before you reboot.

In some Linux versions there isn't much that automatically flushes the
disk cache, and there isn't anything that causes a flush before you
reboot, so you can lose all your changes if you don't sync manually.[1]

This is especially true if you did this to run file system rescue tools
on the disk.


Finally, if you ever need to change a file on disk you can use this
trick to improve your life:

  ] mount / -o remount,rw
  ] edit /path/to/file
  ] mount / -o remount,ro
  ] sync

That will (temporarily) set the disk writable, allow you to edit your
faulty startup file, then make it read-only again.  The sync is for
safety, to push out the changes to disk if the remount wasn't enough.


I occasionally have been forced to resort to that when machines have
been down and a CD is inaccessible or otherwise out of range.


Anyway, I hope you manage to recover from your ReiserFS corruption.  

Regards,
        Daniel

Footnotes: 
[1]  init usually does this.  Since you are using a shell as init, you
     need to do this by hand.
-- 
Digital Infrastructure Solutions -- making IT simple, stable and secure
Phone: 0401 155 707        email: contact at digital-infrastructure.com.au
                 http://digital-infrastructure.com.au/




More information about the NZLUG mailing list