From owner-freebsd-questions@FreeBSD.ORG Fri May 9 02:03:55 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DA2C37B401 for ; Fri, 9 May 2003 02:03:55 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB0E143FD7 for ; Fri, 9 May 2003 02:03:53 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h4993Ww0021864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 May 2003 10:03:32 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)h4993T4O021863; Fri, 9 May 2003 10:03:29 +0100 (BST) (envelope-from matthew) Date: Fri, 9 May 2003 10:03:29 +0100 From: Matthew Seaman To: "Wilkinson,Alex" Message-ID: <20030509090329.GB21358@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , "Wilkinson,Alex" , buga@auug.org.au, freebsd-questions@freebsd.org References: <20030508113346.T16341@squirm.dsto.defence.gov.au> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pvezYHf7grwyp3Bc" Content-Disposition: inline In-Reply-To: <20030508113346.T16341@squirm.dsto.defence.gov.au> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-35.6 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT version=2.53 X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp) cc: buga@auug.org.au cc: freebsd-questions@freebsd.org Subject: Re: disklabel/bsdlabel Question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2003 09:03:55 -0000 --pvezYHf7grwyp3Bc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 08, 2003 at 11:42:52AM +0930, Wilkinson,Alex wrote: > If I want to change the block size and fragment size of a BSD partition w= ill newfs use the > changed values I make in the disklabel or do I still have to use newfs op= tions to specify the > fsize and bsize ? >=20 > In other words, by changing the values of the disklabel, does this make t= he new values the defaultfor newfs ? Good question. It's not entirely clear from the newfs(8) and disklabel(8) man pages exactly what happens. Turning to the source code we see: in /usr/src/sbin/newfs.c: Variables declared and initialized to zero [...] int fsize =3D 0; /* fragment size */ int bsize =3D 0; /* block size */ [...] Values set from command line args, if present: case 'b': if ((bsize =3D atoi(optarg)) < MINBSIZE) fatal("%s: bad block size", optarg); break; [...] case 'f': if ((fsize =3D atoi(optarg)) <=3D 0) fatal("%s: bad fragment size", optarg); break; =20 [...] Read disklabel structure into 'lp' structure, and setup 'pp' as convenience pointer to the list of partitions from the disk label. if (mfs && disktype !=3D NULL) { lp =3D (struct disklabel *)getdiskbyname(disktype); if (lp =3D=3D NULL) fatal("%s: unknown disk type", disktype); pp =3D &lp->d_partitions[1]; (pp is later adjusted to point to the entry for partition in question) [...] If fsize and bsize have not yet been set to non-zero, use the value =66rom the partition entry in the disklabel, or failing that either (fsize) the default value from the parameters at the top of the disklabel or (bsize) calculate from the fsize value. if (fsize =3D=3D 0) { fsize =3D pp->p_fsize; if (fsize <=3D 0) fsize =3D MAX(DFL_FRAGSIZE, lp->d_secsize); } if (bsize =3D=3D 0) { bsize =3D pp->p_frag * pp->p_fsize; if (bsize <=3D 0) bsize =3D MIN(DFL_BLKSIZE, 8 * fsize); } [...] So, in short, the answer to your question is "yes". Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --pvezYHf7grwyp3Bc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE+u27hdtESqEQa7a0RAlclAJ9GUnR8hEWlnQ7wcZFbHxJaIT9oiwCfT12X wsBECCLj/vCuG4gbN6AmPUk= =jEI3 -----END PGP SIGNATURE----- --pvezYHf7grwyp3Bc--