diff options
author | Karel Zak <kzak@redhat.com> | 2010-02-15 14:39:30 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2010-02-15 14:43:49 +0100 |
commit | 78498b7b90cfae7d45912a3c3f80cfca57df95ec (patch) | |
tree | 84045d647ec73b0c19407440ea49605b8539535b | |
parent | d42ef322d04dbd7618455364b6c38c0150e40804 (diff) | |
download | util-linux-78498b7b90cfae7d45912a3c3f80cfca57df95ec.tar.gz |
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 <kzak@redhat.com>
-rw-r--r-- | fdisk/fdisk.8 | 5 | ||||
-rw-r--r-- | 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 <partition> give partition size(s) in blocks\n" "\nOptions:\n" " -b <size> sector size (512, 1024, 2048 or 4096)\n" +" -c switch off DOS-compatible mode\n" " -h print help\n" " -u <size> 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; |