From owner-freebsd-stable Sun Nov 10 4:50:46 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D915437B476 for ; Sun, 10 Nov 2002 04:50:42 -0800 (PST) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id AB81843E42 for ; Sun, 10 Nov 2002 04:50:40 -0800 (PST) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 10 Nov 2002 12:50:39 +0000 (GMT) To: Eugene Grosbein Cc: Paul Mather , Chris BeHanna , FreeBSD-Stable Subject: Re: backups of SUPERBLOCK In-Reply-To: Your message of "Sun, 10 Nov 2002 12:49:32 +0700." <3DCDF36C.F37418E8@kuzbass.ru> Date: Sun, 10 Nov 2002 12:50:34 +0000 From: Ian Dowse Message-ID: <200211101250.aa33786@salmon.maths.tcd.ie> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <3DCDF36C.F37418E8@kuzbass.ru>, Eugene Grosbein writes: >Paul Mather wrote: >> You can use dumpfs to get the real values, e.g.: >> dumpfs /dev/vinum/var | head -20 >Here is what it shows: > ># dumpfs /dev/ad0s1g | head -20 >magic 11954 time Sun Nov 10 12:42:56 2002 >id [ 384288b1 6ad98d3f ] >cylgrp dynamic inodes 4.4BSD >nbfree 53671 ndir 2385 nifree 223067 nffree 31997 >ncg 32 ncyl 500 size 1024000 blocks 992239 >bsize 8192 shift 13 mask 0xffffe000 >fsize 1024 shift 10 mask 0xfffffc00 >frag 8 shift 3 fsbtodb 1 >cpg 16 bpg 4096 fpg 32768 ipg 7808 >minfree 8% optim time maxcontig 15 maxbpg 2048 >rotdelay 0ms rps 60 >ntrak 1 nsect 4096 npsect 4096 spc 4096 >symlinklen 60 trackskew 0 interleave 1 contigsumsize 15 >nindir 2048 inopb 64 nspf 2 maxfilesize 70403120791551 >sblkno 16 cblkno 24 iblkno 32 dblkno 1008 >sbsize 2048 cgsize 6144 cgoffset 2048 cgmask 0xffffffff >csaddr 1008 cssize 1024 shift 9 mask 0xfffffe00 >cgrotor 3 fmod 0 ronly 0 clean 0 >flags soft-updates >(no rotational position table) > >I see bsize and fsize, but don't see cylgroup ration. Please? The superblock location for cylinder group N in units of 512-byte sectors as fsck expects is: (fpg * N + cgoffset * (N & ~cgmask) + sblkno) * (fsize / 512) Most recent filesystems don't use the per cylinder group superblock offset (cgmask is 0xffffffff) so this simplifies to: (fpg * N + sblkno) * (fsize / 512) There are `ncg' cylinder groups, i.e. the values 0..(ncg - 1) are valid cylinder group numbers. For the above filesystem, fpg=32768, sblkno=16, fsize=1024, so that gives backup superblocks at 32, 65568, 131104, 196640 ... 1966112, 2031648. I guess dumpfs should have an option to print the list in the units that fsck expects. Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message