Problem with fsck

Matthew Seaman m.seaman at
Thu Jan 26 12:11:31 PST 2006

manish jain wrote:

> I recently persuaded my organisation to shift our main
> server from Linux to FreeBSD 6.0. We are now facing a
> problem with fsck. After improper shutdown, we need
> fsck to run automatically and non-interactively in the
> foreground upon restart. Enabling background fsck lets
> the system come up but fails to properly start a few
> network services. With background fsck disabled, what
> would be the best way to automatically run 'fsck -fy'
> for each of the partitions upon restart after an
> improper shutdown ? Would it be okay to add the
> corresponding fsck lines somewhere at the top of
> /etc/rc ?

Simply put:


into /etc/rc.conf.  That will cause the box to run 'fsck -p'
in the foreground on each reboot.

Alternatively, if this is a one-off, just hit '4' on the boot-up
menu screen, boot into single user mode and run fsck manually.
First, run 'fsck -p' to automatically repair any filesystems marked
as unclean when shutdown.  If fsck flails and requests human
interaction then run

     fsck /dev/adXsYz

adjusting X, Y and z to suit your local partitioning, and changing
ad to whatever is appropriate if you aren't running on bog-standard
IDE or SATA drives.

Note that it can be quite dangerous to run 'fsck -y' blindly: that
gives fsck permission to destroy otherwise recoverable data if it
needs to in order to get the filesystem back into shape.  

Once fsck shows all your partitions as clean, just hit ^D to let the
system come the rest of the way up.



Dr Matthew J Seaman MA, D.Phil.                       7 Priory Courtyard
                                                      Flat 3
PGP:         Ramsgate
                                                      Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url :

More information about the freebsd-questions mailing list