[wplug] InstallFest Tomorrow

Bryan J. Smith thebs413 at yahoo.com
Fri Aug 10 18:46:27 EDT 2007


Pete Butler <pete at blairhippo.com> wrote:
> Short version, it won't boot.
> It had been working perfectly for several months,
> but a power loss turned it off a few nights ago and now, it just
> complains "Filesystem is NOT clean" and sits there blinking its
> cursor at me.

Welcome to the UNIX-like world Pete!  You've just discovered a common
"issue" with UNIX.  The "solution" is deeper than you realize!  It's
a complete "mindset shift."

You see, in the Windows world, things are always done automagically,
even if you will certainly experience data loss.  In the UNIX world,
things are also done automagically, until you may experience data
loss.  Then it stops and forced you to tell it what to do, even if
it's ultimately to do the automagic fix (that may or may not work).

It's the difference between, "I'm not going to bother you with this"
and "I'm sorry, but I want to bother you before I change something
critical."

When your system lost power, the filesystem was left in an "unclean
state."  Files were open, data written to file buffers weren't
"flushed" to disk, and other "inconsistencies" exist.  Most of the
time, meta-data journaling and other filesystem practices allow the
system to detect the inconsistencies and automatically resolve them
at next boot.

So the next, logical "question" then becomes ...
  What happens if they can't be automatically resolved
    without some data loss?

Windows answer:  I'm not bothering you, I'll always fix it for you
UNIX/Linux answer:  Whoa!  I need you to approve it first.  Or tell
me what to do otherwise.

90% of the time, it wasn't worth your bother, the system probably
could have just fixed it for you and the issue was minor.  But it's
that other 10% of the time, where Windows self-toasts itself (and
trust me, I can't stand NTFS-CHKDSK after 14 years of this ;), the
"bother" was far worth it, because it's now a "bigger bother" because
the server volumes have been, again, self-toasted.

Windows doesn't give you an option to do a "non-destructive" check,
just like they don't give you an option to read-only mount
filesystems.  In fact, during its own boot, Windows actually writes
to its filesystems, so it's already further corrupting an unclean
filesystem already.  So it's almost as if it is saying, "what the
hell, I'll do it anyway, I've already dorked with it during my normal
boot."

UNIX and Linux systems mount filesystems read-only at boot, and
ensure they are consistent before changing single thing.  When they
can fix any inconsistencies without data loss, you won't be bothered.
 But you now have a situation where it's more than just a simple
index, simple stray inode without data, etc... that is an issue. 
You've got a case where inodes conflict, blocks share data, etc...

With UNIX and Linux, the system will let you run a non-destructive,
non-changing "test" or do other things.  And you don't know how many
times that has "saved my bacon" -- especially when I decided to do a
quick "dd" (raw copy) of the filesystem before attempting the
"forced, automated recovery."

> Thanks in advance & see you tomorrow,

Unfortunately (or not so unfortunately for others ;), I won't be at
the meeting.  But you're in good hands.

They'll most likely show you how to first run "fsck -n" to see what
changes are going to occur.  If they are not massive, or the risk is
mitigated, "fsck -y" can be run.  The system itself does "fsck -a" at
boot, which attempts to fix any and all filesystems that were not
unmounted "cleanly" (such as after a power loss), if it can
automagically.  But when it sees a situation it wants to alert you
to, it drops out to the prompt.

It seems like something that you shouldn't be bothered with.  But
understand the UNIX-like mindset is different than Windows.  When you
should be bothered, you should be.  ;)


-- 
Bryan J. Smith   Professional, Technical Annoyance
b.j.smith at ieee.org    http://thebs413.blogspot.com
--------------------------------------------------
     Fission Power:  An Inconvenient Solution


More information about the wplug mailing list