diff options
author | Jeremy Katz <katzj@redhat.com> | 2004-08-23 21:25:52 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2004-08-23 21:25:52 +0000 |
commit | 4fcc0f58700d3d4229f477998fb572774fcd0867 (patch) | |
tree | 15f19ab15631ee2c812fa95f698438a2e5019f1c /lvm.py | |
parent | 00b96265652164d87166666f44155f03b3aecee2 (diff) | |
download | anaconda-4fcc0f58700d3d4229f477998fb572774fcd0867.tar.gz anaconda-4fcc0f58700d3d4229f477998fb572774fcd0867.tar.xz anaconda-4fcc0f58700d3d4229f477998fb572774fcd0867.zip |
some hacks to work around the lvm tools being stupid
* wipe md superblocks if we successfully create a pv (#130713)
* disable filtering for all of our creates. I know better than the
tools (#130706)
Diffstat (limited to 'lvm.py')
-rw-r--r-- | lvm.py | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -15,6 +15,7 @@ import iutil import os,sys import string import math +import isys from flags import flags from rhpl.log import log @@ -226,6 +227,39 @@ def vglist(): return vgs +# FIXME: this is a hack. we really need to have a --force option. +def unlinkConf(): + if os.path.exists("%s/lvm.conf" %(lvmroot,)): + os.unlink("%s/lvm.conf" %(lvmroot,)) + +def writeForceConf(): + """Write out an /etc/lvm/lvm.conf that doesn't do much (any?) filtering""" + + lvmroot = "/etc/lvm" + if not os.path.isdir(lvmroot): + os.mkdir(lvmroot) + + unlinkConf() + + f = open("%s/lvm.conf", "w+") + f.write(""" +# anaconda hacked lvm.conf to avoid filtering breaking things +devices = { + sysfs_scan = 0 + md_component_detection = 0 +} +""") + +# FIXME: another hack. we need to wipe the raid metadata since pvcreate +# doesn't +def wipeOtherMetadataFromPV(node): + try: + isys.wipeRaidSB(node) + except Exception, e: + log("error wiping raidsb from %s: %s", node, e) + + + def getPossiblePhysicalExtents(floor=0): """Returns a list of integers representing the possible values for the physical extent of a volume group. Value is in KB. |