[xen-tools-discuss] xen-delete-image with --partitions

From: Jorge Salamero Sanz <bencer_at_cauterized.net>
Date: Wed, 7 May 2008 17:37:16 +0200
hi all,

first of all, thanks steve for these great tools.

i've found that xen-delete-image doesn't work properly removing the volumes if 
the new option --partitions is used to define a non-default partition => lvm 
scheme.

here there is a "hackish" solution (sorry, i didn't keep the original to send 
a patch):

    elsif ( defined( $CONFIG{'lvm'} ) )
    {
       #
       #  LVM volumes
       #
       #
       #  TODO: Check we're not mounted.
       #

       if ( -e "/dev/$CONFIG{'lvm'}/$hostname-swap" )
       {
           print "Removing swap volume\n";
           
runCommand( "lvremove /dev/$CONFIG{'lvm'}/$hostname-swap --force" );
       }

       if ( -e "/dev/$CONFIG{'lvm'}/$hostname-disk" )
       {
           print "Removing LVM disk volume\n";
           
runCommand( "lvremove /dev/$CONFIG{'lvm'}/$hostname-disk --force" );
       }

       opendir(DIR, "/dev/$CONFIG{'lvm'}");
       my @lvs = grep(/^$hostname-/, readdir(DIR));
       foreach (@lvs) {
           print "Removing $_ volume\n";
           runCommand( "lvremove /dev/$CONFIG{'lvm'}/$_ --force" );
       }

    }
Received on Wed May 07 2008 - 16:37:40 BST

Mailing list overview.