sfdisk: warn if partition size exceeds 2 TiB limit
PATCH 1/1 sfdisk: warn if partition size exceeds 2 TiB limit
From: Roberto Angelino <[email protected]>
Signed-off-by Petr Uzel <[email protected]>
--- fdisk/sfdisk.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
fdisk/sfdisk.c +11 -0
@@ -1293,6 +1293,17 @@ partitions_ok(struct disk_desc *z) { } } +/* Are the partitions within the DOS 2TiB limit? */ + { +for (p = partitions; p < partitions + partno; p++) +if (p->size > (unsigned long )UINT32_MAX ) { +my_warn (_ ("Warning: partition %s of size %lu sectors exceeds " +"msdos 2TiB limit\n" ), +PNO (p), p->size); +return 0 ; + } + } +/* At most one chain of DOS extended partitions ? */ /* It seems that the OS/2 fdisk has the additional requirement that the extended partition must be the fourth one */
Signature · 8 lines
1.7.3.4 Petr -- Petr Uzel IRC: ptr_uzl @ freenode