summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-12-03 22:19:02 +0000
committerJeremy Katz <katzj@redhat.com>2003-12-03 22:19:02 +0000
commit4479c76695851a8ef8e38e181faa7dc0faa6bf32 (patch)
tree962acc1f1780231847cd563a7911863dbc392e35
parenta825156ebad64198906c63a841ab1fad36623664 (diff)
downloadanaconda-4479c76695851a8ef8e38e181faa7dc0faa6bf32.tar.gz
anaconda-4479c76695851a8ef8e38e181faa7dc0faa6bf32.tar.xz
anaconda-4479c76695851a8ef8e38e181faa7dc0faa6bf32.zip
start trying to get working lvm. switch command names for lvm2, do a
vgmknodes after turning on volume groups
-rw-r--r--lvm.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/lvm.py b/lvm.py
index 1f79d1e29..edaff2481 100644
--- a/lvm.py
+++ b/lvm.py
@@ -39,7 +39,7 @@ def has_lvm():
(dev, name) = line[:-1].split(' ', 2)
except:
continue
- if name == "lvm":
+ if name == "device-mapper":
lvmDevicePresent = 1
break
return lvmDevicePresent
@@ -54,8 +54,8 @@ def vgscan():
if flags.test or lvmDevicePresent == 0:
return
- rc = iutil.execWithRedirect("vgscan",
- ["vgscan", "-v"],
+ rc = iutil.execWithRedirect("lvm",
+ ["lvm", "vgscan", "-v"],
stdout = output,
stderr = output,
searchPath = 1)
@@ -72,7 +72,7 @@ def vgactivate(volgroup = None):
if flags.test or lvmDevicePresent == 0:
return
- args = ["vgchange", "-ay", "-An"]
+ args = ["lvm", "vgchange", "-ay", "-An"]
if volgroup:
args.append(volgroup)
rc = iutil.execWithRedirect(args[0], args,
@@ -83,6 +83,18 @@ def vgactivate(volgroup = None):
log("running vgchange failed: %s. disabling lvm" %(rc,))
lvmDevicePresent = 0
+ # now make the device nodes
+ args = ["lvm", "vgmknodes"]
+ if volgroup:
+ args.append(volgroup)
+ rc = iutil.execWithRedirect(args[0], args,
+ stdout = output,
+ stderr = output,
+ searchPath = 1)
+ if rc:
+ log("running vgmknodes failed: %s. disabling lvm" %(rc,))
+ lvmDevicePresent = 0
+
def vgdeactivate(volgroup = None):
"""Deactivate volume groups by running vgchange -an.
@@ -92,7 +104,7 @@ def vgdeactivate(volgroup = None):
if flags.test or lvmDevicePresent == 0:
return
- args = ["vgchange", "-an", "-An"]
+ args = ["lvm", "vgchange", "-an", "-An"]
if volgroup:
args.append(volgroup)
rc = iutil.execWithRedirect(args[0], args,
@@ -114,7 +126,7 @@ def lvremove(lvname, vgname):
if flags.test or lvmDevicePresent == 0:
return
- args = ["lvremove", "-f", "-An"]
+ args = ["lvm", "lvremove", "-f", "-An"]
dev = "/dev/%s/%s" %(vgname, lvname)
args.append(dev)
@@ -142,7 +154,7 @@ def vgremove(vgname):
except:
pass
- args = ["vgremove", vgname]
+ args = ["lvm", "vgremove", vgname]
rc = iutil.execWithRedirect(args[0], args,
stdout = output,