From owner-freebsd-current Tue Oct 16 22:23:32 2001 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 040B337B403; Tue, 16 Oct 2001 22:23:26 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id PAA30180; Wed, 17 Oct 2001 15:23:15 +1000 Date: Wed, 17 Oct 2001 15:22:25 +1000 (EST) From: Bruce Evans X-X-Sender: To: Harti Brandt Cc: , , Subject: Re: newfs fails to build small file systems. In-Reply-To: <20011016144007.L1072-100000@beagle.fokus.gmd.de> Message-ID: <20011017142232.B14272-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 16 Oct 2001, Harti Brandt wrote: > since version 1.41 of newfs.c newfs fails to build 2MByte md-based > file systems. We use these file systems in our diskless pc's. Hrmphh :-). My patch for changing the default number of cylinders per group to the maximum had an (apparently broken) change related to this attached. This part should not have been committed. Backing it out fixes the problem with 2MB disks. Index: newfs.c =================================================================== RCS file: /home/ncvs/src/sbin/newfs/newfs.c,v retrieving revision 1.42 diff -u -2 -r1.42 newfs.c --- newfs.c 4 Oct 2001 12:24:18 -0000 1.42 +++ newfs.c 17 Oct 2001 04:30:46 -0000 @@ -167,5 +159,4 @@ int ntracks = NTRACKS; /* # tracks/cylinder */ int nsectors = NSECTORS; /* # sectors/track */ -int ncyls; /* # complete cylinders */ int nphyssectors; /* # sectors/track including spares */ int secpercyl; /* sectors per cylinder */ @@ -181,5 +172,5 @@ int fsize = 0; /* fragment size */ int bsize = 0; /* block size */ -int cpg = 0; /* cylinders/cylinder group */ +int cpg = DESCPG; /* cylinders/cylinder group */ int cpgflg; /* cylinders/cylinder group flag was given */ int minfree = MINFREE; /* free space threshold */ @@ -546,15 +537,4 @@ } #endif - ncyls = fssize / secpercyl; - if (ncyls == 0) - ncyls = 1; /* XXX */ - if (cpg == 0) - cpg = DESCPG < ncyls ? DESCPG : ncyls; - else if (cpg > ncyls) { - cpg = ncyls; - printf( - "Number of cylinders restricts cylinders per group to %d.\n", - cpg); - } mkfs(pp, special, fsi, fso); #ifdef tahoe > Strange enough newfs still handles 1.44MByte floppies. The (reverse of) the above patch was tested mainly with this size, but it doesn't work for me now. The problem addressed by the patch is that the default geometry of 1 track with 4096 sectors is extremly bogus for devices that don't even have 4096 sectors altogether. Users should override the default geometry for these devices, but most users don't (the release Makefiles set bad examples...), and newfs emits alarming warnings. The changes adjust the number of cylinders to 1 and the number of cylinder groups to 1 if the device size is smaller than 1 cylinder, but other parts of newfsnsist on 2 cylinders per group although this is physically impossible. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message