[nSLUG] e2fsck and "System Maintainance Mode" (Help?)
jwark at bellaliant.net
Sat Nov 11 17:36:59 AST 2017
I might be able to shed some light on this, YMMV.
Mike Spencer wrote:
> Question first, additional background below:
> When fsck offers to go into "System Maintance Mode" at boot time
At boot time, if any kind of failure occurs, the boot scripts may offer
to let you go into single-user/super-user mode. Unfortunately, this mode
is sometimes given confusing names like "System Maintenance Mode" or
"Recovery Mode". The system can only go into this mode if a sufficient
amount of stuff can be read from the root file system before it is
mounted. This was obviously possible because the kernel, and the fsck
code, were read from the root file system.
> after finding a HD problem on hda4,
The problem must have been insufficient for the partition not to be
mounted as root.
There is a directory /var/log/fsck that contains the results of the boot
time fsck runs. On my Debian system it contains two files, checkroot and
checkfs. These list the results of the fsck runs on / and the rest of
the mountable filesystems respectively.
> mount reports that hda4 is
> /dev/hda4 on / type ext2 (rw)
> fsck also suggests trying "e2fsck -v -y /dev/hda4".
The problems found by fsck were insufficient to prevent the boot from
panicking. The message provided by fsck assumes that you will not try to
run this fsck command with the filesystem mounted, a rather dubious
assumption, in my opinion.
> But man fsck says it's dangerous to use fsck on a mounted file system.
> Is "System Maintainance Mode" special in some way?
Yes, see above.
> The last time I hit this, IIRC, I typed the command suggested and all
> was well *except* that the contents of my home directory had vanished!
> (Yes, I had a backup and do now but I'd like to do the right thing if
> Unsure what to do. Suggestions?
> More detailed description:
> While unattended, system rebooted for unknown reasons.
Did you check the logs to see if you could find a reason? George White's
comments suggest that some kind of hard disk failure could be the cause
of the reboot.
> Configured not to do that after a power outage and it was not
> connected to the net.
> Running automatically at boot time, e2fsck reported:
> Duplicate or bad block in use!
> Multiply claimed blocks in inode 4452152: 524288
> e2fsck suggested trying
> e2fsck -v -y /dev/hda4 without -a or -p
> and offered to go into "System Maintainance Mode" if given root
> passwd. Did that.
> Okay: Now logged in as root, mount says:
> /dev/hda4 on / type ext2 (rw)
> /dev/hda3 on /mnt/hda3 type ext2 (rw,nosuid,nodev,user=mds)
> but "umount /mnt/hda3" responds that "/dev/hda3: not mounted" (hda3 is
> data storage, was mounted before the unexplained reboot but is
> "noauto" in /etc/fstab.)
Does your /etc/mtab file contain the actual list of mounted filesystems,
or is it a symlink into the /proc filesystem? If the former, the file
maybe did not get updated when the reboot failed to complete.
> So: + mount & umount give contradictory info and
> + e2fsck has suggested doing what the manpage says is dangerous.
> Previous experience was non-optimal. Is it possible/safe to run fsck
> -y with / mounted or do I have to boot from a rescue/install disk to
> do it safely?
The latter, as you did later.
> If I try to umount /, access to fsck, libs etc. go
> away -- that doesn't seem right.
> I seem to be missing something here.
> Hardware note:
> This is a SATA HD in an IBM P4 desktop that came with an IDE HD.
> The SATA HD is connected to a plug on the motherboard provided
> to make use of SATA drives possible. This has been operational
> for a couple of years.
> nSLUG mailing list
> nSLUG at nslug.ns.ca
Hope this helps.
Jack Warkentin, phone 902-404-0457, email jwark at bellaliant.net
39 Inverness Avenue, Halifax, Nova Scotia, Canada, B3P 1X6
More information about the nSLUG