[PATCH] Specify btrfs volumes by UUID in /etc/fstab.

David Lehman dlehman at redhat.com
Mon Oct 28 23:08:26 UTC 2013


---
 blivet/devices.py    | 6 ++++++
 blivet/devicetree.py | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/blivet/devices.py b/blivet/devices.py
index d620eaf..acde9e7 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -4314,6 +4314,12 @@ class BTRFSDevice(StorageDevice):
     def path(self):
         return self.parents[0].path
 
+    @property
+    def fstabSpec(self):
+        spec = self.format.volUUID
+        if not spec:
+            spec = super(BTRFSDevice, self).fstabSpec
+        return spec
 
 class BTRFSVolumeDevice(BTRFSDevice):
     _type = "btrfs volume"
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 7286af5..253c65a 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -1594,6 +1594,8 @@ class DeviceTree(object):
                 if vol_path in [sv.name for sv in btrfs_dev.subvolumes]:
                     continue
                 fmt = getFormat("btrfs", device=btrfs_dev.path, exists=True,
+                                uuid=btrfs_device.format.uuid,
+                                volUUID=btrfs_device.format.volUUID,
                                 mountopts="subvol=%s" % vol_path)
                 subvol = BTRFSSubVolumeDevice(vol_path,
                                               vol_id=vol_id,
-- 
1.8.1.4



More information about the anaconda-patches mailing list