summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2009-11-03 10:26:14 -0600
committerDavid Lehman <dlehman@redhat.com>2009-11-11 14:47:23 -0600
commit778bc42b2ccbd3efac372f27418c5a2eb4e9e466 (patch)
treedf3d6a5500c549b01c0ce7fabf6302455c5c5a7d /storage
parent2c18a6db62b1d1a7f1adc1264158deb90a054842 (diff)
downloadanaconda-778bc42b2ccbd3efac372f27418c5a2eb4e9e466.tar.gz
anaconda-778bc42b2ccbd3efac372f27418c5a2eb4e9e466.tar.xz
anaconda-778bc42b2ccbd3efac372f27418c5a2eb4e9e466.zip
Align logical partitions' start sector up one logical block for metadata.
Diffstat (limited to 'storage')
-rw-r--r--storage/partitioning.py22
1 files changed, 4 insertions, 18 deletions
diff --git a/storage/partitioning.py b/storage/partitioning.py
index 46815ed48..673c15a00 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -1028,7 +1028,6 @@ def allocatePartitions(disks, partitions, freespace):
disklabel = _disk.format
# create the extended partition if needed
- # TODO: move to a function (disk, free)
if part_type == parted.PARTITION_EXTENDED:
log.debug("creating extended partition")
addPartition(disklabel.partedDisk, free, part_type, None)
@@ -1359,15 +1358,7 @@ def growPartitions(disks, partitions, free):
# recalculate partition geometries
disklabel = disk.format
-
start = chunk.geometry.start
- #if start == 0 or start == getattr(extended_geometry, "start", 0):
- # start += 1
-
- first_logical = False
- if extended_geometry and chunk.contains(extended_geometry):
- first_logical = True
-
new_partitions = []
for p in chunk.requests:
ptype = p.partition.partedPartition.type
@@ -1376,16 +1367,11 @@ def growPartitions(disks, partitions, free):
if ptype == parted.PARTITION_EXTENDED:
continue
- #if ptype == parted.PARTITION_LOGICAL:
- # # As you wish, parted.
- # start += 1
-
- # XXX if the start of the extended is aligned then we must
- # burn one logical block to align the first logical
- # partition
- if ptype == parted.PARTITION_LOGICAL and first_logical:
+ # XXX since we need one metadata sector before each
+ # logical partition we burn one logical block to
+ # safely align the start of each logical partition
+ if ptype == parted.PARTITION_LOGICAL:
start += _a.grainSize
- first_logical = False
old_geometry = p.partition.partedPartition.geometry
new_length = p.base + p.growth