diff options
author | Karel Zak | 2008-08-19 13:53:28 +0200 |
---|---|---|
committer | Karel Zak | 2008-08-19 13:53:28 +0200 |
commit | ee5355e0052889792601c18cae2db0c17d68f61b (patch) | |
tree | 9f263b6f0d71199854324449f656a18c3ba66d0d /fdisk/fdisk.c | |
parent | swapon: -a has to complain, fix leaks (diff) | |
download | kernel-qcow2-util-linux-ee5355e0052889792601c18cae2db0c17d68f61b.tar.gz kernel-qcow2-util-linux-ee5355e0052889792601c18cae2db0c17d68f61b.tar.xz kernel-qcow2-util-linux-ee5355e0052889792601c18cae2db0c17d68f61b.zip |
fdisk: warn users about 2.2TB dos partition limit
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisk/fdisk.c')
-rw-r--r-- | fdisk/fdisk.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c index d3fb1ea96..af41c5d5a 100644 --- a/fdisk/fdisk.c +++ b/fdisk/fdisk.c @@ -20,6 +20,7 @@ #include <sys/stat.h> #include <sys/time.h> #include <time.h> +#include <limits.h> #include "nls.h" #include "blkdev.h" @@ -672,6 +673,17 @@ warn_cylinders(void) { "2) booting and partitioning software from other OSs\n" " (e.g., DOS FDISK, OS/2 FDISK)\n"), cylinders); + + if (total_number_of_sectors > UINT_MAX) { + int giga = (total_number_of_sectors << 9) / 1000000000; + fprintf(stderr, _("\n" +"WARNING: The size of this disk is %d.%d TB (%llu bytes).\n" +"DOS partition table format can not be used on drivers for volumes\n" +"larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID \n" +"partition table format (GPT).\n\n"), + giga/1000, (giga/100)%10, + total_number_of_sectors << 9); + } } static void |