Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jan 2006 20:11:11 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        manish jain <goodredhat@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Problem with fsck
Message-ID:  <43D92CDF.7000502@infracaninophile.co.uk>
In-Reply-To: <20060126193954.27987.qmail@web34013.mail.mud.yahoo.com>
References:  <20060126193954.27987.qmail@web34013.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig80B9FE5FAC750A7B98F1D657
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

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:

    background_fsck=3D"NO"

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. =20

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

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                       7 Priory Courtyard
                                                      Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey         Ramsgate
                                                      Kent, CT11 9PW


--------------enig80B9FE5FAC750A7B98F1D657
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD2Szl8Mjk52CukIwRAzIfAJ927wH7PLtWHwW55DabJOfWxeF8eACfXLUf
W2S0+eUSDfxT/ieXbaBcxZQ=
=eX8Q
-----END PGP SIGNATURE-----

--------------enig80B9FE5FAC750A7B98F1D657--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43D92CDF.7000502>