Re: reboot forcing a fsck

From: Greg 'groggy' Lehey <grog_at_freebsd.org>
Date: Tue, 19 Mar 2024 00:44:53 UTC
On Monday, 18 March 2024 at 14:08:08 -0700, Jim Pazarena wrote:
> I have a server which seems to have a fs issue for my exim folder.
> an "ls -l" hangs. anything going near the exim folder hangs - for
> whatever reason.

When you say "folder", do you mean a directory or a file?  I'm
assuming directory.

> If I trigger a 'reboot', I assume the boot process will
> automatically enter a fsck as per the documentation.

If the file systems are marked "clean", the boot process doesn't
perform an fsck.  Current versions of reboot don't seem to provide the
possibility of forcing fsck on reboot.  The best you could do would be
the -n option, about which the man page says "This option should
probably not be used."

> What is unclear is if the system will eventually g et to multi-user
> mode, or hang at a CLI question from the fsck?

Yes, this is unclear.  If you do get into fsck, and it can't find a
solution, it will prompt for an action.

> I have no hands or eyes available to be there. This is a bare metal
> chassis not a vm.

That's a problem.

A number of possibilities, none of them good:

- Assuming that this is a directory, does ls without the -l option
  work?  That only reads the directory, while -l also reads the inodes
  referenced in the directory.  If so, you can potentially identify
  the damaged file and rename it to something harmless.  Don't try to
  delete it; that could cause more problems.

- Rename the folder and create a new one with the correct name.

- umount the file system on the running system and try running fsck.
  If this is possible, it's probably the best choice.

- run fsdb.  That's arcane, and I don't know how to use it either.  It
  could at least give you some insight into what's wrong.

Ultimately, though, you're going to have to consider console access to
the machine.

> Would appreciate learning the procedure which fsck uses during a
> boot.  (beyond what the man fsck advises) which seems to exclude
> this question.

There's some information in the description of the -F and -B options.
What else would you like to know?

Greg
--
When replying to this message, please copy the original recipients.
If you don't, I may ignore the reply or reply to the original recipients.
For more information, see http://www.lemis.com/questions.html
Sent from my desktop computer.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php