Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jan 2005 23:24:37 +0100
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Ulrich Spoerlein <q@uni.de>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Size of metadata required for GBDE 
Message-ID:  <76988.1107123877@critter.freebsd.dk>
In-Reply-To: Your message of "Sun, 30 Jan 2005 23:18:03 %2B0100." <20050130221803.GB2600@galgenberg.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20050130221803.GB2600@galgenberg.net>, Ulrich Spoerlein writes:

>Hi all,
>
>I just fiddled around with using GBDE for ISO images (it works) and
>stumbled across the need to "guess" the size required for the GBDE
>container.
>
>Looks like the size is not increasing linearly. Here are the numbers of
>512 byte blocks available in md0 and md0.bde
>  md0 | md0.bde | diff.
> 2048    1952       96
> 4096    3936      160
> 8192    7936      256
>16384   15872      512
>32768   31744     1024
>65536   63520     2016
>
>So, what's the correct formula?

First off, if you want to use gbde on a CDROM you should use a sectorsize
of 2048 througout (-S 2048 argument to mdconfig).

The amount of metadata in GBDE is pretty straight forward:

1.	If do not use off-line keyfiles:  deduct one sector.

2.	Deduct the key sectors (1 to 4)

3.	Find zone size:

		nsect = sectorsize / 16
		nzone = nsect + 1

4.	Find number of zones:

		z = remaining_sectors / nzone

5.	Find usable size:

		size = z * nsect

6.	Find overhead/metadata as:

		total_sectors - size

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



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