|
|
|
@ -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"){ |
|
|
|
|