summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2010-02-15 14:39:30 +0100
committerKarel Zak <kzak@redhat.com>2010-02-16 09:58:58 +0100
commit293ee0f0231e3a58dbb30aa846eccb161f093717 (patch)
treef3d3de1454ec4d8e0020b5ac0d83ead288a9024c
parentfaf27705fe74dc5bbe419efcf109a808b8d1d164 (diff)
downloadutil-linux-293ee0f0231e3a58dbb30aa846eccb161f093717.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.85
-rw-r--r--fdisk/fdisk.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/fdisk/fdisk.8 b/fdisk/fdisk.8
index 2d93f1f8a..367837d9d 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 55caa0c2d..b752d9b98 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;