e2fsck and "System Maintainance Mode" (Help?)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

e2fsck and "System Maintainance Mode" (Help?)

Mike Spencer


Question first, additional background below:

When fsck offers to go into "System Maintance Mode" at boot time after
finding a HD problem on hda4, mount reports that hda4 is

              /dev/hda4 on / type ext2 (rw)

fsck also suggests trying "e2fsck -v -y /dev/hda4".

But man fsck says it's dangerous to use fsck on a mounted file system.

Is "System Maintainance Mode" special in some way?

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
possible.)

Unsure what to do. Suggestions?

------------------------------
More detailed description:

While unattended, system rebooted for unknown reasons.  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.)

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?  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
[hidden email]
http://nslug.ns.ca/mailman/listinfo/nslug
Reply | Threaded
Open this post in threaded view
|

Re: e2fsck and "System Maintainance Mode" (Help?)

Douglas Guptill
Hello Mike:

On Fri, Nov 10, 2017 at 04:41:48PM -0400, Mike Spencer wrote:

>
>
> Question first, additional background below:
>
> When fsck offers to go into "System Maintance Mode" at boot time after
> finding a HD problem on hda4, mount reports that hda4 is
>
>               /dev/hda4 on / type ext2 (rw)
>
> fsck also suggests trying "e2fsck -v -y /dev/hda4".
>
> But man fsck says it's dangerous to use fsck on a mounted file system.
>
> Is "System Maintainance Mode" special in some way?

Yes.  The boot is not complete.

> 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
> possible.)
>
> Unsure what to do. Suggestions?

I would try booting from a different system (live CD, rescue disk,
i.e. NOT the system on /dev/hda4.  Then try the fsck command.

HTH,
Douglas.
_______________________________________________
nSLUG mailing list
[hidden email]
http://nslug.ns.ca/mailman/listinfo/nslug
Reply | Threaded
Open this post in threaded view
|

Re: e2fsck and "System Maintainance Mode" (Help?)

George N. White III
In reply to this post by Mike Spencer
On 10 November 2017 at 16:41, Mike Spencer <[hidden email]> wrote:


Question first, additional background below:

When fsck offers to go into "System Maintance Mode" at boot time after
finding a HD problem on hda4, mount reports that hda4 is

              /dev/hda4 on / type ext2 (rw)

fsck also suggests trying "e2fsck -v -y /dev/hda4".

But man fsck says it's dangerous to use fsck on a mounted file system.

Is "System Maintainance Mode" special in some way?

As Douglas said, it means normal boot encountered a problem.

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
possible.)

Unsure what to do. Suggestions?

The first step is to determine if the drive is unhealthy.  It is pointless to
spend time trying to extend the life of a failing disk.

If possible run the vendor's diagnostics.  Smartmon tools supports many
drives.   I have obtained warranty return authorization on the basis of
a smartmon test report, but vendor diagnostics are generally more
complete.

These days it is rare for a drive to fail completely, usually they pretend
to work but more and more disk sectors go bad and performance
suffers.

--
George N. White III <[hidden email]>
Head of St. Margarets Bay, Nova Scotia

_______________________________________________
nSLUG mailing list
[hidden email]
http://nslug.ns.ca/mailman/listinfo/nslug
Reply | Threaded
Open this post in threaded view
|

Re: e2fsck and "System Maintainance Mode" (Help?)

Mike Spencer
In reply to this post by Douglas Guptill

Good news is that I took Douglas' advice, booted from an install DVD
and ran e2fsck.  The details of what it did scrolled away too fast for
me to read but it appears to have "fixed" the problem. (Posting now
from that box.)


me> When fsck offers to go into "System Maintainance Mode" at boot
me> time after finding a HD problem on hda4, mount reports that hda4
me> is
me>
me>               /dev/hda4 on / type ext2 (rw)
me>
me> fsck also suggests trying "e2fsck -v -y /dev/hda4".
me>
me> But man fsck says it's dangerous to use fsck on a mounted file system.
me>
me> Is "System Maintainance Mode" special in some way?

Douglas Guptill <[hidden email]> wrote:

> Yes.  The boot is not complete.

Well, yeah.  The / fs on /hda4 had "errors" yet appeared to be
mounted.  Mount(1) also reported /dev/hda3 as mounted yet umount said
it wasn't.  So "not complete" doesn't illuminate what's going on --
responses are contradictory. Is the kernel reading from the HD fs when
it's not mounted but pretending that it is?  Don't get it.

> I would try booting from a different system (live CD, rescue disk,
> i.e. NOT the system on /dev/hda4.  Then try the fsck command.

Did that.  All appears to be well.  I wish I could have seen which
files' inodes were improperly sharing a block.  Now I don't know what
fsck did to "fix" it.

Then  "George N. White III" <[hidden email]> wrote:

> The first step is to determine if the drive is unhealthy.  It is
> pointless to spend time trying to extend the life of a failing disk.

The HD isn't as old as the machine.  But perhaps it's time to swap in
the little-used IDE drive I have here.  Also don't know what triggered
an unattended reboot overnight.  There have been no new weirdnesses
recently.

There is a curiosity that I've posted about before and no one knew much
about it, probably an idiosyncrasy of this particular release of
hardware.

Machine came with an IDE HD, had mobo plugs for SATA.  When the
previous HD had problems, I took George's approach and replaced it but
all I could get quickly was a used SATA drive.  It all worked as
expected except for two anomalies:

   + Copying from a USB device to the HD has some kind of buffering
     problem.  Large transfers bog the CPU down so that things like
     mouse response is 10s of seconds until the transfer is complete.

   + Playing a DVD video causes the clock to lose time, ca. 10 minutes
     for a typical feature length movie.

None of those was the case with the IDE drive.  I'm guessing something
weird about the IBM mobo hack to support the then-new SATA that wasn't
as fully tested as it should have been.

All seems well for the moment but I'll put setting up the newish IDE
drive on the front burner.

Tnx,
- Mike

--
Michael Spencer                  Nova Scotia, Canada       .~.
                                                           /V\
[hidden email]                                     /( )\
http://home.tallships.ca/mspencer/                        ^^-^^
_______________________________________________
nSLUG mailing list
[hidden email]
http://nslug.ns.ca/mailman/listinfo/nslug
Reply | Threaded
Open this post in threaded view
|

Re: e2fsck and "System Maintainance Mode" (Help?)

Jack Warkentin-2
In reply to this post by Mike Spencer
Hi Mike

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
> possible.)
>
> 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
> [hidden email]
> http://nslug.ns.ca/mailman/listinfo/nslug
>

Hope this helps.

Regards

Jack

Jack Warkentin, phone 902-404-0457, email [hidden email]
39 Inverness Avenue, Halifax, Nova Scotia, Canada, B3P 1X6
_______________________________________________
nSLUG mailing list
[hidden email]
http://nslug.ns.ca/mailman/listinfo/nslug
Reply | Threaded
Open this post in threaded view
|

Re: e2fsck and "System Maintainance Mode" (Help?)

billdavidson
In reply to this post by Mike Spencer
It's been a long time since I had to do that.  Can e2fsck fix problems if the filesystem is mounted ro?  As for mount vs umount, I suspect /etc/mtab is out of date and giving false status of the other fs, but when umount tries to unmount it it finds it is not really mounted.  Can you get a directory listing from /mnt/hda3?

On Nov 10, 2017 4:41 PM, [hidden email] wrote:



Question first, additional background below:

When fsck offers to go into "System Maintance Mode" at boot time after
finding a HD problem on hda4, mount reports that hda4 is

              /dev/hda4 on / type ext2 (rw)

fsck also suggests trying "e2fsck -v -y /dev/hda4".

But man fsck says it's dangerous to use fsck on a mounted file system.

Is "System Maintainance Mode" special in some way?

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
possible.)

Unsure what to do. Suggestions?

------------------------------
More detailed description:

While unattended, system rebooted for unknown reasons.  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.)

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?  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
[hidden email]
http://nslug.ns.ca/mailman/listinfo/nslug



_______________________________________________
nSLUG mailing list
[hidden email]
http://nslug.ns.ca/mailman/listinfo/nslug
Reply | Threaded
Open this post in threaded view
|

Re: e2fsck and "System Maintainance Mode" (Help?)

Mike Spencer

[hidden email] wrote:

> As for mount vs umount, I suspect etc/mtab is out of date and giving
> false status of the ot her fs, but when umount tries to unmount it
> it finds it i s not really mounted.

I forgot that there was a potential ambiguity/contradiction there.  I
still don't understand how single user mode works in
detail. /etc/rc.d/rc.K says in preferatory comment:

# rc.K  This file is executed by init when it goes into runlevel
#       1, which is the administrative state. It kills all
#       daemons and then puts the system into single user mode.
#       Note that the file systems are kept mounted.

All kinds of things are shut down but fs remain mounted.  Huh.

> Can you get a directory listi ng from /mnt/hda3?

No, /mnt/hda3 was empty. (After fix, there was noting wrong with that
partition except "not cleanly unmouted" after the spontaneous reboot.)

All is well for the moment.  A recurrence will merit drastic
measures. :-)

New thing I learned: You can use find(1) with the -inum switch to find
a filename from an inode number.  Never noticed that before.  Wish I'd
know that while the "two files attached to one inode" problem existed.


- Mike

--
Michael Spencer                  Nova Scotia, Canada       .~.
                                                           /V\
[hidden email]                                     /( )\
http://home.tallships.ca/mspencer/                        ^^-^^
_______________________________________________
nSLUG mailing list
[hidden email]
http://nslug.ns.ca/mailman/listinfo/nslug
Reply | Threaded
Open this post in threaded view
|

Re: e2fsck and "System Maintainance Mode" (Help?)

Mike Spencer
In reply to this post by Jack Warkentin-2

At the risk of beating a dead horse (or diagnosing a fully recovered one)...

Jack Warkentin <[hidden email]> wrote:

> There is a directory /var/log/fsck that contains the results of the
> boot time fsck runs.

Neither my main box (2.4 kernel) nor my newer laptop (3.10) has such
a log file.  I had expected there to be some kind of fsck log but I
don't find anything grepping in logs that exist.

There *is* a potential contradiction/conflict there: If fsck looking
for errors in a fs, perhaps it shouldn't go writing to subject fs.

> 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.

Yeah.  "There's a problem.  Try this." doesn't say "Go read the
manpage, reboot from another medium and then  try this."

> Does your /etc/mtab file contain the actual list of mounted
> filesystems, or is it a symlink into the /proc filesystem?

It's a plain text file on both older and newer (Slackware 11.0 and
14.1) systems.

Where in /proc do you find the same info? /proc/mounts seems to have
less detail.


- Mike

--
Michael Spencer                  Nova Scotia, Canada       .~.
                                                           /V\
[hidden email]                                     /( )\
http://home.tallships.ca/mspencer/                        ^^-^^

_______________________________________________
nSLUG mailing list
[hidden email]
http://nslug.ns.ca/mailman/listinfo/nslug