[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: fsck root file system



>>>>> "DW" == David Wright <ichbin@shadlen.org> writes:

    DW> My system got hard-reset and the root file system (ext2) reports
    DW> errors on boot. How can I fsck the root file system?

    DW> 1. I can't do it after a normal boot, because the root file system is
    DW> mounted.

    DW> 2. I can't do it a simple boot floppy, because fsck isn't on the
    DW> floppy. To get fsck, I'd have to mount the file system, but then I
    DW> can't fsck it. Even Tom's rtbt doesn't include fsck.

    DW> 3. I have an old Red Hat 7 install disk with fsck on it, but when I
    DW> boot under it, there is no /dev/hda for me to run it on!

    DW> Would a Debian install CD work? I always install Debian from a net
    DW> boot CD, so I don't have one. What about knoppix? What is the normal
    DW> way to deal with this problem?

    DW> So that I don't have this problem in the future, I'd like to make my
    DW> root file system ext3. Does the stock Debian kernel support this?

Correct me if I'm wrong, but I think all you have to do to fsck your
root disk is:

1. Boot single-user (appending "init=/bin/sh" to the kernel
   commandline accomplishes this handily)

2. When you get the root prompt, your hard disk should be mounted
   readonly. If it's not mounted, mount it with the readonly option
   ("-o ro"). If it's mounted read-write, remount it read-only with
   the remount and read-only options (pass "-o remount,ro" as an
   option to mount).

3. Run fsck.

Incidentally, my box prompts me to drop to a root shell and fsck if it
finds errors on boot.


--Joe

-- 
Joseph Barillari -- http://barillari.org



Reply to: