From owner-freebsd-current Wed Sep 4 12:17:32 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97B5C37B401 for ; Wed, 4 Sep 2002 12:17:16 -0700 (PDT) Received: from mailout11.sul.t-online.com (mailout11.sul.t-online.com [194.25.134.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61FCD43E86 for ; Wed, 4 Sep 2002 12:17:14 -0700 (PDT) (envelope-from D.Rock@t-online.de) Received: from fwd04.sul.t-online.de by mailout11.sul.t-online.com with smtp id 17mfeH-0004xz-0C; Wed, 04 Sep 2002 21:17:09 +0200 Received: from dialin.t-online.de (340029380333-0001@[80.128.207.55]) by fmrl04.sul.t-online.com with esmtp id 17mfeA-0sgo4mC; Wed, 4 Sep 2002 21:17:02 +0200 Received: from t-online.de (doom [172.23.7.254]) by dialin.t-online.de (8.11.6+Sun/8.11.6/Rock) with ESMTP id g84JGKv02673; Wed, 4 Sep 2002 21:16:20 +0200 (CEST) Message-ID: <3D765C1E.8040701@t-online.de> Date: Wed, 04 Sep 2002 21:16:46 +0200 From: Daniel Rock User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.1) Gecko/20020826 X-Accept-Language: de, en-us, en MIME-Version: 1.0 To: Bruce Evans Cc: current@FreeBSD.ORG Subject: Re: fsck cannot find superblock References: <20020904171953.I460-100000@gamplex.bde.org> Content-Type: multipart/mixed; boundary="------------010104060401000706010007" X-Sender: 340029380333-0001@t-dialin.net Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------010104060401000706010007 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Bruce Evans schrieb: >On Tue, 3 Sep 2002, D. Rock wrote: > > > >>with 'uncommon' block sizes fsck seems to have problems finding the >>superblock: >> >># newfs -i 10240 -b 4096 -f 512 /dev/ad1d >>Reduced frags per cylinder group from 26208 to 26200 to enlarge last cyl group >>/dev/ad1d: 409.6MB (838860 sectors) block size 4096, fragment size 512 >> using 33 cylinder groups of 12.79MB, 3275 blks, 1312 inodes. >>super-block backups (for fsck -b #) at: >> 32, 26232, 52432, 78632, 104832, 131032, 157232, 183432, 209632, 235832, >> 262032, 288232, 314432, 340632, 366832, 393032, 419232, 445432, 471632, >> 497832, 524032, 550232, 576432, 602632, 628832, 655032, 681232, 707432, >> 733632, 759832, 786032, 812232, 838432 >># fsck /dev/ad1d >>** /dev/ad1d >>Cannot find file system superblock >> >>LOOK FOR ALTERNATE SUPERBLOCKS? [yn] n >> >> > >fsck_ffs has no problems here with (whole) md disk of the same size. >Perhaps I have fixed the problem without noticing. dumpfs or comparison >with a non-broken filesystem of the same size might show the problem. > >Bruce > > I have attached the label of the offending disk and an output of a dumpfs on a freshly created file system with the following options: newfs -b 4096 -f 4096 /dev/ad1d newfs -b 8192 -f 8192 /dev/ad1d The problem seems to be introduced with the UFS2 import. In src/sbin/fsck_ffs/setup.c the sanity checks are more tightly formulated. Especially one check was added: sblock.fs_bsize >= SBLOCKSIZE this fails on 4K file systems, because fs_bsize is only 4096, but SBLOCKSIZE is defined as 8192. The sanity checks for searching alternate superblocks are more relaxed (in readsb() the first if branch is entered, not the else branch), so during searching for alternate superblocks the very same sb that was rejected in the first run (at offset 8192) will be used. Possible solutions: * remove above sanity check * does SBLOCKSIZE really have to be 8192, in real it is much smaller (less than 2KB) * drop support for 4K block sizes completely, but this breaks backwards compatibility Daniel --------------010104060401000706010007 Content-Type: text/plain; name="disklabel.ad1" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="disklabel.ad1" # /dev/ad1c: type: ESDI disk: ad0s1 label: flags: bytes/sector: 512 sectors/track: 252 tracks/cylinder: 4 sectors/cylinder: 1008 cylinders: 2482 sectors/unit: 2501856 rpm: 4500 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0 8 partitions: # size offset fstype [fsize bsize bps/cpg] b: 462996 2038860 swap # (Cyl. 2022*- 2481*) c: 2501856 0 unused 0 0 # (Cyl. 0 - 2481) d: 838860 0 4.2BSD 512 4096 26200 # (Cyl. 0 - 832*) e: 1200000 838860 4.2BSD 2048 8192 48388 # (Cyl. 832*- 2022*) --------------010104060401000706010007 Content-Type: text/plain; name="dumpfs.4K" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dumpfs.4K" magic 11954 (UFS1) time Wed Sep 4 20:33:22 2002 id [ 3d7651f2 4b7c67bc ] ncg 8 size 104857 blocks 103972 bsize 4096 shift 12 mask 0xfffff000 fsize 4096 shift 12 mask 0xfffff000 frag 1 shift 0 fsbtodb 3 minfree 8% optim time symlinklen 60 maxbpg 512 maxcontig 32 contigsumsize 16 nbfree 103971 ndir 1 nifree 27389 nffree 0 cpg 1 bpg 13681 fpg 13681 ipg 3424 nindir 1024 inopb 32 nspf 8 maxfilesize 4402345721855 sbsize 4096 cgsize 4096 cgoffset 0 cgmask 0xffffffff csaddr 114 cssize 4096 rotdelay 0ms rps 60 trackskew 0 interleave 1 nsect 109448 npsect 109448 spc 109448 sblkno 4 cblkno 6 iblkno 7 dblkno 114 cgrotor 0 fmod 0 ronly 0 clean 1 flags none cs[].cs_(nbfree,ndir,nifree,nffree): (13565,1,3421,0) (13571,0,3424,0) (13571,0,3424,0) (13571,0,3424,0) (13571,0,3424,0) (13571,0,3424,0) (13571,0,3424,0) (8980,0,3424,0) cylinders in last group 1 blocks in last group 9090 cg 0: magic 90255 tell 6000 time Wed Sep 4 20:33:22 2002 cgx 0 ncyl 1 niblk 3424 ndblk 13681 nbfree 13565 ndir 1 nifree 3421 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 0 0 0 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 116-13680 inodes used: 0-2 blks free: 116-13680 cg 1: magic 90255 tell 3577000 time Wed Sep 4 20:33:22 2002 cgx 1 ncyl 1 niblk 3424 ndblk 13681 nbfree 13571 ndir 0 nifree 3424 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 0 0 1 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 0-3, 114-13680 inodes used: blks free: 0-3, 114-13680 cg 2: magic 90255 tell 6ae8000 time Wed Sep 4 20:33:22 2002 cgx 2 ncyl 1 niblk 3424 ndblk 13681 nbfree 13571 ndir 0 nifree 3424 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 0 0 1 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 0-3, 114-13680 inodes used: blks free: 0-3, 114-13680 cg 3: magic 90255 tell a059000 time Wed Sep 4 20:33:22 2002 cgx 3 ncyl 1 niblk 3424 ndblk 13681 nbfree 13571 ndir 0 nifree 3424 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 0 0 1 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 0-3, 114-13680 inodes used: blks free: 0-3, 114-13680 cg 4: magic 90255 tell d5ca000 time Wed Sep 4 20:33:22 2002 cgx 4 ncyl 1 niblk 3424 ndblk 13681 nbfree 13571 ndir 0 nifree 3424 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 0 0 1 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 0-3, 114-13680 inodes used: blks free: 0-3, 114-13680 cg 5: magic 90255 tell 10b3b000 time Wed Sep 4 20:33:22 2002 cgx 5 ncyl 1 niblk 3424 ndblk 13681 nbfree 13571 ndir 0 nifree 3424 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 0 0 1 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 0-3, 114-13680 inodes used: blks free: 0-3, 114-13680 cg 6: magic 90255 tell 140ac000 time Wed Sep 4 20:33:22 2002 cgx 6 ncyl 1 niblk 3424 ndblk 13681 nbfree 13571 ndir 0 nifree 3424 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 0 0 1 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 0-3, 114-13680 inodes used: blks free: 0-3, 114-13680 cg 7: magic 90255 tell 1761d000 time Wed Sep 4 20:33:22 2002 cgx 7 ncyl 1 niblk 3424 ndblk 9090 nbfree 8980 ndir 0 nifree 3424 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 0 0 1 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 0-3, 114-9089 inodes used: blks free: 0-3, 114-9089 --------------010104060401000706010007 Content-Type: text/plain; name="dumpfs.8K" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dumpfs.8K" magic 11954 (UFS1) time Wed Sep 4 20:36:41 2002 id [ 3d7652b9 7ac04d77 ] ncg 4 size 52428 blocks 52209 bsize 8192 shift 13 mask 0xffffe000 fsize 8192 shift 13 mask 0xffffe000 frag 1 shift 0 fsbtodb 4 minfree 8% optim time symlinklen 60 maxbpg 1024 maxcontig 16 contigsumsize 16 nbfree 52208 ndir 1 nifree 13309 nffree 0 cpg 1 bpg 13108 fpg 13108 ipg 3328 nindir 2048 inopb 64 nspf 16 maxfilesize 70403120791551 sbsize 8192 cgsize 8192 cgoffset 0 cgmask 0xffffffff csaddr 56 cssize 8192 rotdelay 0ms rps 60 trackskew 0 interleave 1 nsect 209728 npsect 209728 spc 209728 sblkno 2 cblkno 3 iblkno 4 dblkno 56 cgrotor 0 fmod 0 ronly 0 clean 1 flags none cs[].cs_(nbfree,ndir,nifree,nffree): (13050,1,3325,0) (13054,0,3328,0) (13054,0,3328,0) (13050,0,3328,0) cylinders in last group 1 blocks in last group 13104 cg 0: magic 90255 tell 6000 time Wed Sep 4 20:36:41 2002 cgx 0 ncyl 1 niblk 3328 ndblk 13108 nbfree 13050 ndir 1 nifree 3325 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 0 0 0 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 58-13107 inodes used: 0-2 blks free: 58-13107 cg 1: magic 90255 tell 666e000 time Wed Sep 4 20:36:41 2002 cgx 1 ncyl 1 niblk 3328 ndblk 13108 nbfree 13054 ndir 0 nifree 3328 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 1 0 0 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 0-1, 56-13107 inodes used: blks free: 0-1, 56-13107 cg 2: magic 90255 tell ccd6000 time Wed Sep 4 20:36:41 2002 cgx 2 ncyl 1 niblk 3328 ndblk 13108 nbfree 13054 ndir 0 nifree 3328 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 1 0 0 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 0-1, 56-13107 inodes used: blks free: 0-1, 56-13107 cg 3: magic 90255 tell 1333e000 time Wed Sep 4 20:36:41 2002 cgx 3 ncyl 1 niblk 3328 ndblk 13104 nbfree 13050 ndir 0 nifree 3328 nffree 0 rotor 0 irotor 0 frotor 0 frsum sum of frsum: 0 clusters 1-8: 0 1 0 0 0 0 0 0 clusters 9-15: 0 0 0 0 0 0 0 clusters size 16 and over: 1 clusters free: 0-1, 56-13103 inodes used: blks free: 0-1, 56-13103 --------------010104060401000706010007-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message