From 3da49d8e68dd6b975495efb52a1d7c07e9a72c3f Mon Sep 17 00:00:00 2001 From: grog Date: Tue, 22 Jun 1999 05:53:57 +0000 Subject: [PATCH] vinum_ldi: Show the available sectors relative to the user-available part of the drive (don't include the config space at the beginning). This stops an empty drive reporting only 99% available. Requested-by: staylor printconfig: Show sizes in sectors with the suffix 's' instead of the now-deprecated 'b'. --- sbin/vinum/list.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sbin/vinum/list.c b/sbin/vinum/list.c index e4fa78c2f1de..c454262b3728 100644 --- a/sbin/vinum/list.c +++ b/sbin/vinum/list.c @@ -189,7 +189,8 @@ vinum_ldi(int driveno, int recurse) printf("\n"); /* can't print percentages */ else printf(" (%d%%)\n", - (int) ((drive.sectors_available * 100 * DEV_BSIZE) / drive.label.drive_size)); + (int) ((drive.sectors_available * 100 * DEV_BSIZE) + / (drive.label.drive_size - DATASTART))); } if (stats) { if (verbose || Verbose) { @@ -878,7 +879,7 @@ printconfig(FILE * of, char *comment) plex_org(plex.organization)); if ((plex.organization == plex_striped) || (plex.organization == plex_raid5)) { - fprintf(of, "%db ", (int) plex.stripesize); + fprintf(of, "%ds ", (int) plex.stripesize); } if (plex.volno >= 0) { /* we have a volume */ get_volume_info(&vol, plex.volno); @@ -895,7 +896,7 @@ printconfig(FILE * of, char *comment) get_drive_info(&drive, sd.driveno); get_plex_info(&plex, sd.plexno); fprintf(of, - "%ssd name %s drive %s plex %s len %qdb driveoffset %qdb plexoffset %qdb\n", + "%ssd name %s drive %s plex %s len %qds driveoffset %qds plexoffset %qds\n", comment, sd.name, drive.label.name,