--- storage/partitioning.py | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/storage/partitioning.py b/storage/partitioning.py index a23efb3..8c6858f 100644 --- a/storage/partitioning.py +++ b/storage/partitioning.py @@ -583,7 +583,16 @@ def getDiskAlignment(disk): disk -- a parted.Disk instance """ - return parted.Alignment(offset=0, grainSize=1) + device = disk.device + try: + a = device.optimumAlignment.intersect(disk.partitionAlignment) + except ArithmeticError: + try: + a = device.minimumAlignment.intersect(disk.partitionAlignment) + except ArithmeticError: + a = disk.partitionAlignment + + return a def sectorsToSize(sectors, sectorSize): """ Convert length in sectors to size in MB. -- 1.6.5.2 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list