Yet another SUPERBLOCK/LABEL problem
itetcu at tecnik93.com
itetcu at tecnik93.com
Wed Jan 7 19:34:54 PST 2004
[please cc, excuse formating - webmail]
Short question:
A few hours before the new year I've cvsup'ed from 5.1R-p11 to current
(.) and make everything. The system failed to boot up becouse of
WRITE_DMA failling. I've managed to boot with hw.ata.ata_dma: 0. After
using the system a few hours, celebrting the new year, etc., I've
tried to atacontrol the disk in UDMA2 mode and got only a warning;
beging testing with iozone on /tmp; hard crash; it locked up. Upon
resting, booting in single user and fsck-ing:
it>/mnt# fsck_ffs -n /dev/ad3s1f
** /dev/ad3s1f (NO WRITE)
BAD SUPER BLOCK: VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST
ALTERNATE
/dev/ad3s1f: INCOMPLETE LABEL: type 4.2BSD fsize 0, frag 0, cpg 0,
size 74513744
and
bsdlabel -N /dev/ad3s1
# /dev/ad3s1:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
a: 524288 0 4.2BSD 0 0 0
b: 2053552 524288 swap
c: 78140160 0 unused 0 0 # "raw" part,
don't edit
d: 524288 2577840 4.2BSD 0 0 0
e: 524288 3102128 4.2BSD 0 0 0
f: 74513744 3626416 4.2BSD 0 0 0
Strangelly, the other partition fsck'd OK.
Tried to restore thte label values by hand with fsize 2048 and bsize
16384; didn't know the bps/cpg value so I've newfs ad3s1d (/tmp),
which gave me 32776, which I used on a, d, e; but I don't know how to
figure the value for f.
it>/mnt# bsdlabel /dev/ad3s1
# /dev/ad3s1:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
a: 524288 0 4.2BSD 2048 16384 32776
b: 2053552 524288 swap
c: 78140160 0 unused 0 0 # "raw" part,
don't edit
d: 524288 2577840 4.2BSD 2048 16384 32776
e: 524288 3102128 4.2BSD 2048 16384 32776
f: 74513744 3626416 4.2BSD 2048 16384 0
it>/mnt# fsck_ffs -n /dev/ad3s1f
** /dev/ad3s1f (NO WRITE)
BAD SUPER BLOCK: VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST
ALTERNATE
/dev/ad3s1f: INCOMPLETE LABEL: type 4.2BSD fsize 2048, frag 8, cpg 0,
size 74513744
The last is being printed out by src/sbin/fsck_ffs/setup.c's calcsb:
if (pp->p_fsize == 0 || pp->p_frag == 0 ||
pp->p_cpg == 0 || pp->p_size == 0) {
pfatal("%s: %s: type %s fsize %d, frag %d, cpg %d, size %d\n",
dev, "INCOMPLETE LABEL", fstypenames[pp->p_fstype],
pp->p_fsize, pp->p_frag, pp->p_cpg, pp->p_size);
return (0);
}
On fsck-ing with alternates superblocks printed out by newfs -n :
....
UNKNOWN FILE TYPE I=3933178
UNEXPECTED SOFT UPDATE INCONSISTENCY
CLEAR? no
PARTIALLY ALLOCATED INODE I=3933179
UNEXPECTED SOFT UPDATE INCONSISTENCY
CLEAR? no
PARTIALLY ALLOCATED INODE I=3933180
UNEXPECTED SOFT UPDATE INCONSISTENCY
CLEAR? no
UNKNOWN FILE TYPE I=3933181
UNEXPECTED SOFT UPDATE INCONSISTENCY
....
until fsck gives up with
fsck_ffs: bad inode number 3933184 to nextinode
If I'm cmp the output of
dd if=/dev/ad3s1f skip=160 bs=512 count=16 of=sb1
with dd output using alternates superblocks they are identical for the
first few but differ for the last few.
I've tried to change the sources of newfs (mkfs.c) to also get the
bps/cpg value on newfs -N (as the newfs was made from a 5.1 sysinstall
without any custom options) but I'm doing something wrong.
So my question is how can I figure out bps/cpg or what else I can do
get the superblock OK and the partion data back.
Thanks,
IOnut
More information about the freebsd-questions
mailing list