dangerous situation with shutdown process

Matthias Buelow mkb at incubus.de
Sat Jul 16 14:29:06 GMT 2005


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

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

mkb.


More information about the freebsd-stable mailing list