dangerous situation with shutdown process

Bill Vermillion bv at wjv.com
Sat Jul 16 14:42:41 GMT 2005


At Sat, Jul 16, 2005 at 16:29 , our malformed and occasionally 
flatulent friend Matthias Buelow spewed forth this fount of brain juice:

> Bill Vermillion wrote:

> >You can fsck a mounted file system and fsck will run in read-only
> >mode.  That way you can check for problems, and if there is
> >something wrong you can shutdown and restart.  FreeBSD will NOT
> >run fsck in anything other than READ ONLY when the file system is
> >mounted

> I thought fsck on a live (read-write) filesystem almost always
> brings up errors (although only of a certain kind, like dangling
> inodes) unless the fs has been completely quiescent for a while.

> A quick check seems to confirm this:

> ** /dev/ad4s3a (NO WRITE)
> ** Last Mounted on /
> ** Root file system
> ** Phase 1 - Check Blocks and Sizes
> ** Phase 2 - Check Pathnames
> ** Phase 3 - Check Connectivity
> ** Phase 4 - Check Reference Counts
> UNREF FILE I=94257  OWNER=mkb MODE=100600
> SIZE=2397 MTIME=Jul 16 16:25 2005 
> CLEAR? no

The 'no' was supplied by the system, was it not.  First line
sas NO WRITE.

> >And in the old days when drives were smaller and slower and
> >perfomance needed to be maximized, from about Verision III through
> >System V you could run   fsck -S <device> from cron!!

> >The -S flag was interesting in that it would actually re-write
> >the freelist IF AND ONLY IF there was no corruption on the drive.

> I'm amazed that this worked.. considering that the fsck would have
> to be atomic then (i.e., basically halt all filesystem i/o while
> it's running).

We'd run it from cron as noted.  And this was done overnight - in
systems where users were there only in the daytime.  It did make a
difference in keeping perfomance up longer than without it.

Without that you'd basically have to backup the fs, remake the fs,
and then reload to get back the originally installed performance.

But as I noted this was for the S51 file system.  It was really
slow.  On my first Sys V.3 system, I made one file system
with the old S51/Xenix layout, and everthing else was an FFS that
was slightly modified from the the original BSD systems.  That was
probably about 1990.

The performance on the S51 ON THE SAME DRIVE - was no better than
30% as fast as the FSS and most of the time it was only 10% as
fast.

Once all the old customers moved to newer OS versions the old
fsck -S [note that it is capital S and not 's' - and you'll have to
find a Sys V manual to document the differentce - and I don't
have one handy at the moment].

And small businesses were very very reluctant to upgrade unless
they were forced too.  I did some Y2K patching on OSes that had
been installed in the late 1980s.  And about the latest anyone
would be using a system there would be about 9PM - when the owner
stayed late.

With current systems, in particular net connected systems with 
email, you could not hope to find a quiescent system.  

However the S flag was rewrite the freelist ONLY if the rest of 
the fsck gave no errors.  If there were problems, such as the
unrefferenced file you showed in your example, the freelist would
not be re-written.  That's why it was OK to run it in cron.

Anyone who had not worked with Unix systems of 10-25 years ago can't
begin to appreciate how good things are today.

Bill
-- 
Bill Vermillion - bv @ wjv . com


More information about the freebsd-stable mailing list