Subject: Re: filesystem issues after rude powerdown
To: None <netbsd-users@NetBSD.org>
From: Ignatios Souvatzis <ignatios@cs.uni-bonn.de>
List: netbsd-users
Date: 08/03/2004 14:14:12
--L2Brqb15TUChFOBK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Aug 03, 2004 at 07:50:59AM -0400, Brian wrote:
>=20
> On Tuesday, August 3, 2004, at 05:34 AM, Ignatios Souvatzis wrote:
> >
> >Then you should run something that listens to the UPS and shutdowns the
> >machine cleanly when the time is near. All a battery-powered UPS is=20
> >supposed to do is to help you survive short power failures, give you tim=
e to=20
> >start your diesel generators, or do a clean shutdown. If you insist to=
=20
> >survive longer outages on battery, you need ... bigger batteries.
> >
>=20
> What exists that would let me configure output to the serial port? =20

Look into pkgsrc - I think there are a few tools, and maybe the one for
your UPS is there.

> I might have to pull the (IDE) HD out, put it in a desktop, and=20
> reformat the partition using appropriate tools that way.  But as you=20
> say, I would have expected bad blocks should get remapped automagically=
=20
> using the reserved areas.

Well, not necessarily; this is often only enabled for write accesses! You
got the error _reading_ the disk!

> >Assuming (check that!) that the error message was from the driver, and
> >refers to disk block numbers (as from the file system, and refers to
> >filesystem sectors), you could try to
> >
> >umount /tmp (in single user mode, obviously)
> >
> >/sbin/sysctl kern.rawpartition
> >
> >if it is 3:
> >dd bs=3D512 count=3D13 if=3D/dev/zero seek=3D756 of=3D/dev/rwd0d (on i387
> >
> >if it is 2:
> >dd bs=3D512 count=3D13 if=3D/dev/zero seek=3D756 of=3D/dev/rwd0c
> >
> >After that you'll have to "fsck -f" the affected file system.
> >
> >You do this at your own risk; read the manual pages until you=20
> >understand
> >what those commands do. Especially, as you didn't show the original
> >error message, I have no idea whether it really referred to disk blocks
> >or filesystem sectors (which would be relative to the partition=20
> >boundary,
> >and using units!)
> >
>=20
> At bootup, I get this (my system hung again, after bootup I captured=20
> the console output this time):
>=20
> 	Starting file system checks:
> 	/dev/rwd0a: file system is clean; not checking
> 	/dev/rwd0f: file system is clean; not checking
> 	wd0: transfer error, downgrading to Ultra-DMA mode 1
> 	wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 1 (using DMA data=20
> transfers)
> 	wd0g: error reading fsbn 736 of 736-847 (wd0 bn 4782688; cn 4744 tn=20
> 	11 sn 43), retrying

Ah... those were file system block numbers, but it is translating them to
disk blocks (the wd0 bn 4782688 part).

Translate my recipe appropriately - this might help you.

Regards,
	Ignatios

--L2Brqb15TUChFOBK
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: 2.6.i

iQEVAgUBQQ+BkDCn4om+4LhpAQGe2Qf/coawY/oa2J5Er1ZNVcXtvwNTFGYPds+I
avpsWTLfSLGobGn89BeANNuJ9cZK5YDSt9p5rbuRIqE5xbHnGOCjJgb8evU+NH9j
LroAyoQMv/Xmfd//1nlrDRyOYIcVYL/SKVHisjtJwkhD2rAq2NT/oAhwrp9MDWnL
UjSs1yQT9umS+DZUxUGhEa6n4MWxRfDbeNlwhrf3yxkUByD5fJdQs1LE84oTwLPD
ttMeKvToWOTu9DaxwCx91nz2XOMgWTOao8IB3V6vchWC0amYp5HzgyJ8EqH9wJT+
aJ2O3wK7OKi5DZ/Vz3Tw8LBML35am2gq7OBAfCzuRRVuCInDkcVLLg==
=n3T5
-----END PGP SIGNATURE-----

--L2Brqb15TUChFOBK--