summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-09-09 13:03:09 +0000
committerjoerg <joerg@FreeBSD.org>1995-09-09 13:03:09 +0000
commit07c20bb253580b2025a0ce7e3d6748f01d1b1f0e (patch)
tree39fd875204ebc0a07e2ad685bd9a3d2cb48f9f9e /sbin/newfs
parentde26dac73e741823c6709d241f04dc5b5cfe45ec (diff)
downloadFreeBSD-src-07c20bb253580b2025a0ce7e3d6748f01d1b1f0e.zip
FreeBSD-src-07c20bb253580b2025a0ce7e3d6748f01d1b1f0e.tar.gz
Avoid the "calculated sectors per cylinder disagrees with disklabel"
warning for the default case where the user hasn't specified either -t or -u on the command line. It's been confusing our users.
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/newfs.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index ed74706..759bf63 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -189,6 +189,7 @@ int nrpos = NRPOS; /* # of distinguished rotational positions */
int bbsize = BBSIZE; /* boot block size */
int sbsize = SBSIZE; /* superblock size */
int mntflags = MNT_ASYNC; /* flags to be passed to mount */
+int t_or_u_flag_provided = 0; /* user has specified -t or -u */
u_long memleft; /* virtual memory available */
caddr_t membase; /* start address of memory based filesystem */
char *filename;
@@ -326,10 +327,12 @@ main(argc, argv)
fatal("%s: bad file system size", optarg);
break;
case 't':
+ t_or_u_flag_provided++;
if ((ntracks = atoi(optarg)) < 0)
fatal("%s: bad total tracks", optarg);
break;
case 'u':
+ t_or_u_flag_provided++;
if ((nsectors = atoi(optarg)) < 0)
fatal("%s: bad sectors/track", optarg);
break;
@@ -494,7 +497,12 @@ main(argc, argv)
cylspares = 0;
}
secpercyl = nsectors * ntracks - cylspares;
- if (secpercyl != lp->d_secpercyl)
+ /*
+ * Only complain if -t or -u have been specified; the default
+ * case (4096 sectors per cylinder) is intented to disagree
+ * with the disklabel.
+ */
+ if (t_or_u_flag_provided && secpercyl != lp->d_secpercyl)
fprintf(stderr, "%s (%d) %s (%lu)\n",
"Warning: calculated sectors per cylinder", secpercyl,
"disagrees with disk label", lp->d_secpercyl);
OpenPOWER on IntegriCloud