From ee5355e0052889792601c18cae2db0c17d68f61b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 19 Aug 2008 13:53:28 +0200 Subject: [PATCH] fdisk: warn users about 2.2TB dos partition limit Signed-off-by: Karel Zak --- fdisk/fdisk.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c index d3fb1ea9..af41c5d5 100644 --- a/fdisk/fdisk.c +++ b/fdisk/fdisk.c @@ -20,6 +20,7 @@ #include #include #include +#include #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 -- 2.39.5