From 293ee0f0231e3a58dbb30aa846eccb161f093717 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 15 Feb 2010 14:39:30 +0100 Subject: [PATCH] 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 --- fdisk/fdisk.8 | 5 ++++- fdisk/fdisk.c | 13 +++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) 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; -- 2.39.5