summaryrefslogtreecommitdiffstats
path: root/storage/formats/disklabel.py
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-08-26 11:36:26 +0200
committerHans de Goede <hdegoede@redhat.com>2009-08-26 14:05:05 +0200
commit2df409943ea6f60a1248b43bcc009e6219938152 (patch)
tree5e43439f46eb247d1597570ef3372b3469f3b531 /storage/formats/disklabel.py
parentba830a8f261320674693c820c6d24f0ba39afdc3 (diff)
downloadanaconda-2df409943ea6f60a1248b43bcc009e6219938152.tar.gz
anaconda-2df409943ea6f60a1248b43bcc009e6219938152.tar.xz
anaconda-2df409943ea6f60a1248b43bcc009e6219938152.zip
Do not try to commit disks changes to the os while partitions are in use
In storage.doIt() we set the bootable flag for the /boot or / (or special platform boot) partition. And then we call bootdev.format.commit(), however this will lead to parted trying to tell the kernel to rescan the partition table which will usually fail, as usually we have some VolGroup active at this point. All we really need todo is make sure the bootable flag gets written to the disk, so this patch adds a commitToDisk() method to formats.disklabel and uses that. We were not bitten by this before because uptil now parted was silently ignoring ebusy errors for us (BAD parted, BAD!).
Diffstat (limited to 'storage/formats/disklabel.py')
-rw-r--r--storage/formats/disklabel.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/storage/formats/disklabel.py b/storage/formats/disklabel.py
index b3b81eda0..08e2461da 100644
--- a/storage/formats/disklabel.py
+++ b/storage/formats/disklabel.py
@@ -208,6 +208,13 @@ class DiskLabel(DeviceFormat):
if keepTrying:
raise DeviceFormatError("cannot commit to disk after %d attempts" % (maxTries,), )
+ def commitToDisk(self):
+ """ Commit the current partition table to disk. """
+ try:
+ self.partedDisk.commitToDevice()
+ except parted.DiskException as msg:
+ raise DeviceFormatError(msg)
+
def addPartition(self, *args, **kwargs):
partition = kwargs.get("partition", None)
if not partition: