Subject: bin/9230: disklabel doesn't describe sgs field
To: None <gnats-bugs@gnats.netbsd.org>
From: None <deberg@mit.edu>
List: netbsd-bugs
Date: 01/18/2000 14:23:19
>Number:         9230
>Category:       bin
>Synopsis:       disklabel output doesn't label the segshift field
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 18 14:21:00 2000
>Last-Modified:
>Originator:     matt debergalis
>Organization:
matt debergalis <deberg@mit.edu> KB1CTH
finger deberg@ai.mit.edu for PGP key
>Release:        1.4P
>Environment:
System: NetBSD chamomile.deberg.org 1.4P NetBSD 1.4P (DEBERG) #6: Tue Jan 18 14:58:53 EST 2000 deberg@chamomile.deberg.org:/src/netbsd/src/sys/arch/i386/compile/DEBERG i386


>Description:
	disklabel labels the cylinders/group column "cpg", but lfs uses
	this as the "segshift" (sgs) field, which isn't obvious.
>How-To-Repeat:
	wonder why newfs_lfs chose a ludicrous segment size.  realize
	it's using the cpg field as the default shift value.
>Fix:
	here's a suggested patch, which increases the width of the
	disklabel output by 2 columns.  at the very least, the cpg
	heading should also include "/sgs"

Index: disklabel.c
===================================================================
RCS file: /cvsroot/basesrc/sbin/disklabel/disklabel.c,v
retrieving revision 1.80
diff -c -c -r1.80 disklabel.c
*** disklabel.c	2000/01/18 00:02:28	1.80
--- disklabel.c	2000/01/18 22:13:04
***************
*** 1178,1184 ****
  
  	(void) fprintf(f, "%d partitions:\n", lp->d_npartitions);
  	(void) fprintf(f,
! 	    "#        size   offset     fstype   [fsize bsize   cpg]\n");
  	pp = lp->d_partitions;
  	for (i = 0; i < lp->d_npartitions; i++, pp++) {
  		if (pp->p_size) {
--- 1178,1184 ----
  
  	(void) fprintf(f, "%d partitions:\n", lp->d_npartitions);
  	(void) fprintf(f,
! 	    "#        size   offset     fstype   [fsize bsize cpg/sgs]\n");
  	pp = lp->d_partitions;
  	for (i = 0; i < lp->d_npartitions; i++, pp++) {
  		if (pp->p_size) {
***************
*** 1208,1232 ****
  			switch (pp->p_fstype) {
  
  			case FS_UNUSED:				/* XXX */
! 				(void) fprintf(f, "    %5d %5d %5.5s ",
  				    pp->p_fsize, pp->p_fsize * pp->p_frag, "");
  				break;
  
  			case FS_BSDFFS:
  			case FS_ADOS:
! 				(void) fprintf(f, "    %5d %5d %5d ",
  				    pp->p_fsize, pp->p_fsize * pp->p_frag,
  				    pp->p_cpg);
  				break;
  
  			case FS_BSDLFS:
! 				(void) fprintf(f, "    %5d %5d %5d ",
  				    pp->p_fsize, pp->p_fsize * pp->p_frag,
  				    pp->p_sgs);
  				break;
  
  			case FS_EX2FS:
! 				(void) fprintf(f, "    %5d %5d       ",
  				    pp->p_fsize, pp->p_fsize * pp->p_frag);
  				break;
  
--- 1208,1232 ----
  			switch (pp->p_fstype) {
  
  			case FS_UNUSED:				/* XXX */
! 				(void) fprintf(f, "    %5d %5d %7.7s ",
  				    pp->p_fsize, pp->p_fsize * pp->p_frag, "");
  				break;
  
  			case FS_BSDFFS:
  			case FS_ADOS:
! 				(void) fprintf(f, "    %5d %5d %7d ",
  				    pp->p_fsize, pp->p_fsize * pp->p_frag,
  				    pp->p_cpg);
  				break;
  
  			case FS_BSDLFS:
! 				(void) fprintf(f, "    %5d %5d %7d ",
  				    pp->p_fsize, pp->p_fsize * pp->p_frag,
  				    pp->p_sgs);
  				break;
  
  			case FS_EX2FS:
! 				(void) fprintf(f, "    %5d %5d         ",
  				    pp->p_fsize, pp->p_fsize * pp->p_frag);
  				break;
  

>Audit-Trail:
>Unformatted: