Date: Wed, 17 Oct 2001 15:22:25 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Harti Brandt <brandt@fokus.gmd.de> Cc: <roberto@freebsd.org>, <bde@freebsd.org>, <current@freebsd.org> Subject: Re: newfs fails to build small file systems. Message-ID: <20011017142232.B14272-100000@delplex.bde.org> In-Reply-To: <20011016144007.L1072-100000@beagle.fokus.gmd.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011017142232.B14272-100000>