Subject: Re: filesystem issues after rude powerdown
To: None <netbsd-users@NetBSD.org>
From: Aaron J. Grier <agrier@poofygoof.com>
List: netbsd-users
Date: 08/03/2004 10:25:16
On Tue, Aug 03, 2004 at 07:50:59AM -0400, Brian wrote:
> What exists that would let me configure output to the serial port?
> This is a headless, non-USB Cobalt Qube, it would have to be something
> that would take for input the USB output from the UPS, and then on the
> serial console, issue the shutdown commands.

or alternately, another machine with USB could report the UPS' state
over the network.  this is only useful if you have more than one machine
plugged into the UPS, though.

> I'd read of issues (likely here) trying to get USB-capable NetBSD
> boxes to trigger shutdown based on UPS output; I didn't think that was
> working well even on systems with working USB.

look in pkgsrc/sysutils/ups-nut.  http://www.networkupstools.org/ has
the list of supported UPSes.  my decstations and sparcs have no trouble
shutting themselves down during extended power outages.

> What's the best way to reformat /tmp or rebuild the partition map for 
> this partition from within NetBSD?  Just fdisk it, or is there a more 
> thorough way to format & test?  I didn't notice any

fdisk/disklabel will only change the partition table.  newfs will change
only a filesystem layout; it won't touch all sectors in a partition.
from your indications, you don't have a problem with the partition
table; only a sector in the 'g' partition.

since this is /tmp, I'm assuming you can blow it away without losing
anything.  you could go to single user mode, and force the system to
write every sector in the affected partition:

# dd if=/dev/zero of=/dev/rwd0g bs=1024k

after which you'll need to reformat the /tmp partition:

# newfs wd0g

that may not actually fix your problem if the drive isn't doing any
remapping.

it seems that FFS doesn't do well if its underlying block device isn't
behaving reliably.

-- 
  Aaron J. Grier | "Not your ordinary poofy goof." | agrier@poofygoof.com
  "someday the industry will have throbbing frontal lobes and will be able
  to write provably correct software.  also, I want a pony." -- Zach Brown