From: Petr Uzel <petr.uzel@suse.cz>
To: util-linux <util-linux@vger.kernel.org>
Subject: [PATCH] sfdisk: warn if partition starts above 2 TiB limit
Date: Fri, 1 Jul 2011 13:11:56 +0200 [thread overview]
Message-ID: <20110701111154.GA24105@foxbat.suse.cz> (raw)
[-- 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 --]
next reply other threads:[~2011-07-01 11:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-01 11:11 Petr Uzel [this message]
2011-07-01 13:11 ` [PATCH] sfdisk: warn if partition starts above 2 TiB limit Karel Zak
2011-07-01 13:33 ` Petr Uzel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110701111154.GA24105@foxbat.suse.cz \
--to=petr.uzel@suse.cz \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox