summaryrefslogtreecommitdiff
path: root/basicmbr.cc
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2011-06-26 22:40:06 -0400
committersrs5694 <srs5694@users.sourceforge.net>2011-06-26 22:40:06 -0400
commit00b6d7a4604e759eb3c92b3ecea608d6fe024b81 (patch)
treec47703bea8a55b25f90e9b9cc8a54cc3c51c10e9 /basicmbr.cc
parent6aae2a9b70e9f88926baad94c1eea40e0b534f01 (diff)
downloadsgdisk-00b6d7a4604e759eb3c92b3ecea608d6fe024b81.tar.gz
0.7.2 release, includes new Linux type code & true GUID generation in
Windows
Diffstat (limited to 'basicmbr.cc')
-rw-r--r--basicmbr.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/basicmbr.cc b/basicmbr.cc
index 54b4809..4f193e2 100644
--- a/basicmbr.cc
+++ b/basicmbr.cc
@@ -130,9 +130,9 @@ int BasicMBRData::ReadMBRData(const string & deviceFilename) {
// Read data from MBR. If checkBlockSize == 1 (the default), the block
// size is checked; otherwise it's set to the default (512 bytes).
-// Note that any extended partition(s) present will be explicitly stored
-// in the partitions[] array, along with their contained partitions; the
-// extended container partition(s) should be ignored by other functions.
+// Note that any extended partition(s) present will be omitted from
+// in the partitions[] array; these partitions must be re-created when
+// the partition table is saved in MBR format.
int BasicMBRData::ReadMBRData(DiskIO * theDisk, int checkBlockSize) {
int allOK = 1, i, logicalNum = 0;
int err = 1;
@@ -1100,7 +1100,8 @@ void BasicMBRData::SortMBR(int start) {
// Delete any partitions that are too big to fit on the disk
// or that are too big for MBR (32-bit limits).
-// This really deletes the partitions by setting values to 0.
+// This deletes the partitions by setting values to 0, not just
+// by setting them as being omitted.
// Returns the number of partitions deleted in this way.
int BasicMBRData::DeleteOversizedParts() {
int num = 0, i;
@@ -1108,6 +1109,8 @@ int BasicMBRData::DeleteOversizedParts() {
for (i = 0; i < MAX_MBR_PARTS; i++) {
if ((partitions[i].GetStartLBA() > diskSize) || (partitions[i].GetLastLBA() > diskSize) ||
(partitions[i].GetStartLBA() > UINT32_MAX) || (partitions[i].GetLengthLBA() > UINT32_MAX)) {
+ cerr << "\aWarning: Deleting oversized partition #" << i + 1 << "! Start = "
+ << partitions[i].GetStartLBA() << ", length = " << partitions[i].GetLengthLBA() << "\n";
partitions[i].Empty();
num++;
} // if