Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Nov 2002 12:50:34 +0000
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        Eugene Grosbein <eugen@kuzbass.ru>
Cc:        Paul Mather <paul@gromit.dlib.vt.edu>, Chris BeHanna <behanna@zbzoom.net>, FreeBSD-Stable <stable@FreeBSD.ORG>
Subject:   Re: backups of SUPERBLOCK 
Message-ID:   <200211101250.aa33786@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Sun, 10 Nov 2002 12:49:32 %2B0700." <3DCDF36C.F37418E8@kuzbass.ru> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <200211101250.aa33786>