logger.debug("Assigning %s partitions to disks", self.ptable_format)
+ # The number of primary and logical partitions. Extended partition and
+ # partitions not listed in the table are not included.
+ num_real_partitions = len([p for p in self.partitions if not p.no_table])
+
# Go through partitions in the order they are added in .ks file
for num in range(len(self.partitions)):
part = self.partitions[num]
# Skip one sector required for the partitioning scheme overhead
self.offset += overhead
- if self.realpart > 3:
+ if self.realpart > 3 and num_real_partitions > 4:
# Reserve a sector for EBR for every logical partition
# before alignment is performed.
if self.ptable_format == "msdos":
if self.ptable_format == "msdos":
# only count the partitions that are in partition table
- if len([p for p in self.partitions if not p.no_table]) > 4:
+ if num_real_partitions > 4:
if self.realpart > 3:
part.type = 'logical'
part.num = self.realpart + 1