From owner-freebsd-stable@FreeBSD.ORG Sun Jan 30 22:24:40 2005 Return-Path: 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 1842816A4CE for ; Sun, 30 Jan 2005 22:24:40 +0000 (GMT) Received: from critter.freebsd.dk (f170.freebsd.dk [212.242.86.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B82E43D49 for ; Sun, 30 Jan 2005 22:24:39 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.1/8.13.1) with ESMTP id j0UMObsX076989; Sun, 30 Jan 2005 23:24:37 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Ulrich Spoerlein From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 30 Jan 2005 23:18:03 +0100." <20050130221803.GB2600@galgenberg.net> Date: Sun, 30 Jan 2005 23:24:37 +0100 Message-ID: <76988.1107123877@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: freebsd-stable@freebsd.org Subject: Re: Size of metadata required for GBDE X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jan 2005 22:24:40 -0000 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.