summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2008-11-17 14:47:43 -0600
committerDavid Lehman <dlehman@redhat.com>2008-11-17 14:50:26 -0600
commitef6e19535cf181ef06a1e76fc02792807fc78334 (patch)
treedfbdfd8dc53a897d5bf1795105956e7b54465ab6
parent80e813bfdabb5e92d49227ab8faa2e586445f082 (diff)
downloadanaconda-ef6e19535cf181ef06a1e76fc02792807fc78334.tar.gz
anaconda-ef6e19535cf181ef06a1e76fc02792807fc78334.tar.xz
anaconda-ef6e19535cf181ef06a1e76fc02792807fc78334.zip
Resolve dm-X devices returned by pvdisplay. (#448129)
pvdisplay is finding devices with names like /dev/dm-0, which is not useful to us since we use names like /dev/mapper/luks-<uuid>.
-rw-r--r--lvm.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/lvm.py b/lvm.py
index d1de501c8..00f7c02cf 100644
--- a/lvm.py
+++ b/lvm.py
@@ -373,6 +373,19 @@ def pvlist():
size = long(math.floor(long(size) / (1024 * 1024)))
except:
continue
+
+ if dev.startswith("/dev/dm-"):
+ from block import dm
+ try:
+ sb = os.stat(dev)
+ (major, minor) = (os.major(sb.st_rdev), os.minor(sb.st_rdev))
+ for map in dm.maps():
+ if map.dev.major == major and map.dev.minor == minor:
+ dev = "/dev/mapper/%s" % map.name
+ break
+ except:
+ pass
+
log.info("pv is %s in vg %s, size is %s" %(dev, vg, size))
pvs.append( (dev, vg, size) )