From: Karel Zak Date: Mon, 15 Feb 2010 13:39:30 +0000 (+0100) Subject: fdisk: add -c option (switch off DOS mode) X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78498b7b90cfae7d45912a3c3f80cfca57df95ec;p=util-linux fdisk: add -c option (switch off DOS mode) * add -c to allows to switch off DOS mode from command line * recommend sectors (command 'u' or option -u) Signed-off-by: Karel Zak --- diff --git a/fdisk/fdisk.8 b/fdisk/fdisk.8 index 2d93f1f8..367837d9 100644 --- a/fdisk/fdisk.8 +++ b/fdisk/fdisk.8 @@ -6,7 +6,7 @@ fdisk \- Partition table manipulator for Linux .SH SYNOPSIS .B fdisk -.RB [ \-u ] +.RB [ \-uc ] .RB [ \-b .IR sectorsize ] .RB [ \-C @@ -187,6 +187,9 @@ to override the kernel's ideas.) .BI \-h Print help and then exit. .TP +.BI \-c +Switch off DOS-compatible mode. (Recommended) +.TP .BI "\-C " cyls Specify the number of cylinders of the disk. I have no idea why anybody would want to do so. diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c index 55caa0c2..b752d9b9 100644 --- a/fdisk/fdisk.c +++ b/fdisk/fdisk.c @@ -259,6 +259,7 @@ void fatal(enum failure why) { " fdisk -s give partition size(s) in blocks\n" "\nOptions:\n" " -b sector size (512, 1024, 2048 or 4096)\n" +" -c switch off DOS-compatible mode\n" " -h print help\n" " -u give sizes in sectors instead of cylinders\n" " -v print version\n" @@ -794,7 +795,12 @@ warn_alignment(void) { " sectors (command 'u').\n")); else fprintf(stderr, ".\n"); - } + + } else if (display_in_cyl_units) + fprintf(stderr, _("\n" +"WARNING: cylinders as display units are deprecated. Use command 'u' to\n" +" change units to sectors.\n")); + } static void @@ -2857,7 +2863,7 @@ main(int argc, char **argv) { bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - while ((c = getopt(argc, argv, "b:C:hH:lsS:uvV")) != -1) { + while ((c = getopt(argc, argv, "b:cC:hH:lsS:uvV")) != -1) { switch (c) { case 'b': /* Ugly: this sector size is really per device, @@ -2874,6 +2880,9 @@ main(int argc, char **argv) { case 'C': user_cylinders = atoi(optarg); break; + case 'c': + dos_compatible_flag = 0; + break; case 'h': fatal(help); break;