Ignore:
Timestamp:
Oct 5, 2008, 6:01:54 PM (16 years ago)
Author:
broder
Message:

Explicitly lock an LV before trying to delete it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-remctl-auto/files/usr/sbin/sipb-xen-lvm

    r837 r1066  
    4242    lvpath = "/dev/" + vg + "/" + lvname
    4343if subcommand == "lvremove":
     44    def error():
     45        print >>sys.stderr, "Error removing LV %s\n" % lvname
     46        sys.exit(1)
     47    rv = call(["/sbin/lvchange", "-a", "n", lvpath])
     48    if rv != 0:
     49        error()
     50    rv = call(["/sbin/lvchange", "-a", "ey", lvpath])
     51    if rv != 0:
     52        error()
    4453    rv = call(["/sbin/lvremove", "--force", lvpath])
     54    if rv != 0:
     55        error()
    4556    ensureoff(machine)
    46     if rv != 0:
    47         print >>sys.stderr, "Error removing LV %s\n" %(lvname,)
    48         sys.exit(1)
    4957elif subcommand == "lvresize":
    5058    size = sys.argv[4]
Note: See TracChangeset for help on using the changeset viewer.