diff options
author | David Lehman <dlehman@redhat.com> | 2008-11-17 14:47:43 -0600 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2008-11-17 14:50:26 -0600 |
commit | ef6e19535cf181ef06a1e76fc02792807fc78334 (patch) | |
tree | dfbdfd8dc53a897d5bf1795105956e7b54465ab6 | |
parent | 80e813bfdabb5e92d49227ab8faa2e586445f082 (diff) | |
download | anaconda-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.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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) ) |