diff options
author | Joel Granados Moreno <jgranado@redhat.com> | 2009-01-27 13:43:08 +0100 |
---|---|---|
committer | Joel Granados Moreno <jgranado@redhat.com> | 2009-01-27 15:09:15 +0100 |
commit | e0e3ec22906dd5adaf88d6347c689cc339b00f1d (patch) | |
tree | d1c1a26898b444c2c157e494b7bdddc7a5a9a125 | |
parent | 33836f3d225137a62dd3e55d33a4a906c7e5e0b8 (diff) | |
download | anaconda-e0e3ec22906dd5adaf88d6347c689cc339b00f1d.tar.gz anaconda-e0e3ec22906dd5adaf88d6347c689cc339b00f1d.tar.xz anaconda-e0e3ec22906dd5adaf88d6347c689cc339b00f1d.zip |
Remove missing PVs before removing obsolete VG (#481698).
Missing PV (e.g. due to drive removal) of obsolete VG
can make lvm vgremove call fail.
Also add verbose flag to pvremove call.
-rw-r--r-- | lvm.py | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -166,7 +166,17 @@ def vgremove(vgname): except: pass - args = ["lvm", "vgremove", vgname] + args = ["lvm", "vgreduce", "-v", "--removemissing", "--force", vgname] + + log(string.join(args, ' ')) + rc = iutil.execWithRedirect(args[0], args, + stdout = output, + stderr = output, + searchPath = 1) + if rc: + raise SystemError, "vgreduce failed" + + args = ["lvm", "vgremove", "-v", vgname] log(string.join(args, ' ')) rc = iutil.execWithRedirect(args[0], args, @@ -178,7 +188,7 @@ def vgremove(vgname): # now iterate all the PVs we've just freed up, so we reclaim the metadata # space. This is an LVM bug, AFAICS. for pvname in pvs: - args = ["lvm", "pvremove", pvname] + args = ["lvm", "pvremove", "-ff", "-y", "-v", pvname] log(string.join(args, ' ')) rc = iutil.execWithRedirect(args[0], args, |