Re: Yet another SUPERBLOCK/LABEL problem

2004-01-09 Thread Sergey 'DoubleF' Zaharchenko
On Thu,  8 Jan 2004 07:36:37 +0200
[EMAIL PROTECTED] probably wrote:
 
 it/mnt# newfs -N /dev/ad3s1f | head
 /dev/ad3s1f: 36383.7MB (74513744 sectors) block size 16384, fragment 
 size 2048 using 198 cylinder groups of 183.77MB, 11761 blks, 23552 
 inodes.

Sorry for the delay. A cylinder group for you is 11761*16384=192692224
bytes. Tell me what your cylinder size (look up the geometry given by
disklabel and multiply sectors/cylinder by 512) is and I will tell you
how many cylinders per group you have (just divide).

HTH,


-- 
DoubleF
The faster we go, the rounder we get.
-- The Grateful Dead


pgp0.pgp
Description: PGP signature


Yet another SUPERBLOCK/LABEL problem

2004-01-07 Thread itetcu
[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   offsetfstype   [fsize bsize bps/cpg]
  a:   52428804.2BSD0 0 0 
  b:  2053552   524288  swap
  c: 781401600unused0 0 # raw part, 
don't edit
  d:   524288  25778404.2BSD0 0 0 
  e:   524288  31021284.2BSD0 0 0 
  f: 74513744  36264164.2BSD0 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   offsetfstype   [fsize bsize bps/cpg]
  a:   52428804.2BSD 2048 16384 32776
  b:  2053552   524288  swap
  c: 781401600unused0 0 # raw part, 
don't edit
  d:   524288  25778404.2BSD 2048 16384 32776
  e:   524288  31021284.2BSD 2048 16384 32776
  f: 74513744  36264164.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
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Yet another SUPERBLOCK/LABEL problem

2004-01-07 Thread itetcu
Scrive Sergey 'DoubleF' Zaharchenko [EMAIL PROTECTED]:

 On Thu,  8 Jan 2004 05:34:44 +0200
 [EMAIL PROTECTED] probably wrote:
 
 Hi Ion,
 
  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.
 
 What does the ordinary newfs -N say for you? For me, it says:
  Warning: Block size and bytes per inode restrict cylinders per
 group to 22.
  /dev/ad2s2a:2097152 sectors in 512 cylinders of 1 tracks,
 4096 sectors
  1024.0MB in 24 cyl groups (22 c/g, 44.00MB/g, 10624 i/g)
   ^
 /-/
 This values seems to be what you want.
 I'm not sure it'll work the same way for 5.x though.

it/mnt# newfs -N /dev/ad3s1f | head
/dev/ad3s1f: 36383.7MB (74513744 sectors) block size 16384, fragment 
size 2048 using 198 cylinder groups of 183.77MB, 11761 blks, 23552 
inodes.
super-block backups (for fsck -b #) at:
 160, 376512, 752864, 1129216, 1505568, 1881920, 2258272, 2634624, 
3010976, .

So no luck here :). I've tried adding some fprintf in the newfs code 
(like fs_fcg and fs_ncg), but obviously I've did something wrong and 
the values don't make any sense.

Thanks,
IOnut
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]