Don't try to detect backing LVM volume is snapshot is disabled

tags/virt-backup-0.2.22-1
Daniel Berteaud 5 years ago
parent 49564a10d0
commit f641d7b636
  1. 8
      virt-backup

@ -410,6 +410,9 @@ sub prepare_backup{
}
# If the disk is a file
elsif ($disk->{type} eq 'file'){
my $file = $source;
# Try to snapshot this device
if ( $opts{snapshot} ){
# Try to find the mount point, and the backing device
my @df = `df -PT $source`;
my ($dev, undef, undef, undef, undef, undef, $mount) = split /\s+/, $df[1];
@ -432,11 +435,8 @@ sub prepare_backup{
die "Couldn't detect the backing device for $source. You should pass it as argument like --lvm=/dev/vg/lv\n\n";
}
my $mp = $lvm;
$mp =~ s!/!_!g;
$mp =~ s|/|_|g;
$mp = "$backupdir.mount/$mp/";
my $file = $source;
# Try to snapshot this device
if ( $opts{snapshot} ){
# Maybe the LVM is already snapshoted and mounted for a previous disk ?
my $is_mounted = 0;
if (open MOUNT, "<$backupdir.meta/mount"){

Loading…
Cancel
Save