[xen-tools-discuss] xen-delete-image with --partitions
Jorge Salamero Sanz
bencer at cauterized.net
Wed May 7 17:37:16 CEST 2008
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" );
}
}
More information about the xen-tools-discuss
mailing list