Commit e8c79ac5 authored by Hussamuddin Nasir's avatar Hussamuddin Nasir

Many LV segments fail on "dmsetup remove" because they are still mounted. Need...

Many LV segments fail on "dmsetup remove" because they are still mounted. Need to unmount them before the remove operation.
parent 1eddd90b
......@@ -5199,6 +5199,11 @@ sub lvmDestroyVolume($$)
$dmname =~ s#/#-#;
foreach my $part (1..4) {
my $dev = "${dmname}p$part";
if (-e "/dev/mapper/$dev") {
# Many cases the partition needs to be unmounted before it can be
# removed
mysystem2("umount /dev/mapper/$dev");
}
if (-e "/dev/mapper/$dev" && !mysystem2("dmsetup remove $dev")) {
print STDERR "WARNING: removed leftover partdev '$dev'\n";
$tryagain = 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment