Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] sfdisk: warn if partition starts above 2 TiB limit
@ 2011-07-01 11:11 Petr Uzel
  2011-07-01 13:11 ` Karel Zak
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Uzel @ 2011-07-01 11:11 UTC (permalink / raw)
  To: util-linux

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]


Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
---
 fdisk/sfdisk.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c
index 4ed5d37..d498371 100644
--- a/fdisk/sfdisk.c
+++ b/fdisk/sfdisk.c
@@ -1304,6 +1304,17 @@ partitions_ok(struct disk_desc *z) {
 	    }
     }
 
+    /* Do the partitions start below the DOS 2TiB limit? */
+    {
+	for (p = partitions; p < partitions + partno; p++)
+	    if (p->size && p->start > (unsigned long) UINT32_MAX) {
+	        my_warn(_("Warning: partition %s has starting sector %lu, "
+		          "which is above the DOS 2 TiB limit\n"),
+			PNO(p), p->start);
+		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 */
-- 
1.7.3.4


Petr

--
Petr Uzel
IRC: ptr_uzl @ freenode

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-01 13:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-01 11:11 [PATCH] sfdisk: warn if partition starts above 2 TiB limit Petr Uzel
2011-07-01 13:11 ` Karel Zak
2011-07-01 13:33   ` Petr Uzel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox