Subject: newfs trouble
To: None <netbsd-users@netbsd.org>
From: Roy Bixler <rcbixler@nyx.net>
List: netbsd-users
Date: 11/06/2005 12:40:10
I'm having filesystem problems and am looking for help.

But, first, by way of background, I have been using NetBSD for a while
(since the 1.5.x days) and thought I was pretty well versed in it.
Some time ago, when I was running v. 2.0, I bought an additional hard
disk.  It is an IBM 73 G. SCSI drive.  I only partitioned a part of it
figuring I would add partitions as I needed space.

I finally got the new disk going and used it for about a year under
v. 2.0 and v. 2.0.2 with no trouble.  Then, yesterday, I upgraded to
v. 2.1.  At first, it seemed that this was going to be a very smooth
upgrade.  When I rebooted, everything came up just as before and,
unlike previous upgrades, there was no need to tinker with the files
in /etc.

The trouble began when I downloaded the latest pkgsrc.tar.gz file and
used one of the partitions on the new disk to unpack the files.  In
the middle of the extraction, the system froze hard and I to reboot
using the power button.  "fsck" found a few errors, but that was
expected.  I ran "fsck -f" on the partition afterwards just to be sure
and it found no more errors.  When I tried "rm -rf pkgsrc", it failed
when removing some of the subdirectories claiming that they "weren't
empty."  When I did "ls -al pkgsrc", it showed an empty directory.

I figured there must be some pretty extensive corruption on the
filesystem, so I backed up the other directories there and then did a
"newfs" command on it.  That also failed.  It would get to a certain
point and then give a message like

wtfs: write error: Undefined error: 0

I didn't write down the exact message, but I tried repeatedly and it
always died at the same number when writing superblock backups.

Right now, I am running the system under Debian sarge.  I recreated
the partitions under Linux and was able to create a couple of ext2
filesystems without any trouble.  So that would seem to rule out
hardware trouble.

If it's helpful, here is the disklabel file:

# /dev/sd0d:
type: SCSI
disk: DTN073W3UWDY10F
label: data
flags:
bytes/sector: 512
sectors/track: 651
tracks/cylinder: 6
sectors/cylinder: 3906
cylinders: 36703
total sectors: 143374000
rpm: 7200
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

8 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:  20000862        63     4.2BSD   1024  8192    16  # (Cyl.      0*-   5120*)
 b:  29993355  20000925     4.2BSD   1024  8192    16  # (Cyl.   5120*-  12799*)
 c: 143373937        63     unused      0     0        # (Cyl.      0*-  36706*)
 d: 143374000         0     unused      0     0        # (Cyl.      0 -  36706*)

Suggestions, anyone?

-- 
Roy Bixler <rcbixler@nyx.net>
"The fundamental principle of science, the definition almost, is this: the
sole test of the validity of any idea is experiment."
-- Richard P. Feynman