From owner-freebsd-questions@FreeBSD.ORG Wed Jan 7 19:34:54 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8666016A4CE for ; Wed, 7 Jan 2004 19:34:54 -0800 (PST) Received: from upipe0.schmolie.com (upipe0.schmolie.com [207.109.186.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 1AFDF43D2F for ; Wed, 7 Jan 2004 19:34:46 -0800 (PST) (envelope-from itetcu@tecnik93.com) Received: (qmail 10960 invoked by uid 2525); 8 Jan 2004 03:34:44 -0000 Received: from 81.196.25.19 ( [81.196.25.19]) as user itetcu@localhost by webmail.tecnik93.com with HTTP; Thu, 8 Jan 2004 05:34:44 +0200 Message-ID: <1073532884.3ffccfd4be203@webmail.tecnik93.com> Date: Thu, 8 Jan 2004 05:34:44 +0200 From: itetcu@tecnik93.com To: questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.1 X-Originating-IP: 81.196.25.19 Subject: Yet another SUPERBLOCK/LABEL problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2004 03:34:54 -0000 [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