[PATCH 3/3] Destroy (potential) stale metadata when creating a new partition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ensure old metadata which lived in freespace (or did not get detected in
some other way) and thus did not get explictly destroyed by a destroyformat
action gets wiped when we create a new partition.

One example of this is: do autopart install, nuke part table, do auto part
install again, then we will hit pv creation issues because the old pv meta
data is still there.
---
 storage/devices.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 53b3e8f..0904286 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -108,7 +108,7 @@ import platform
 from errors import *
 from iutil import log_method_call, notify_kernel, numeric_type
 from udev import *
-from formats import get_device_format_class, getFormat
+from formats import get_device_format_class, getFormat, DeviceFormat
 
 import gettext
 _ = lambda x: gettext.ldgettext("anaconda", x)
@@ -1157,6 +1157,10 @@ class PartitionDevice(StorageDevice):
         self.disk.addPartition(self)
         self.disk.commit()
 
+        # Ensure old metadata which lived in freespace so did not get
+        # explictly destroyed by a destroyformat action gets wiped
+        DeviceFormat(device=self.path, exists=True).destroy()
+
         self.partedPartition = self.disk.partedDisk.getPartitionByPath(self.path)
 
         self.exists = True
-- 
1.6.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux