vg=$1 lv=$2
## Remove the snapshot. Sometimes LVM doesn't notice that the snapshot is
- ## no longer in open immdiately, so try several times.
+ ## no longer in open immdiately, so try several times. Sometimes, more
+ ## mysteriously, something is keeping the filesystem from being unmounted,
+ ## so try that several times and report on things keeping the filesystem
+ ## open.
hostrun "unsnap-lvm $vg/$lv" "
- umount $SNAPDIR/$lv
+ for i in 1 2 3 4; do
+ echo \";;; BEGIN fuser -mv $SNAPDIR/$lv\"
+ fuser -mv $SNAPDIR/$lv | sed 's/^/;;; /'
+ echo \";;; END fuser -mv $SNAPDIR/$lv\"
+ echo \";;; BEGIN lsof $SNAPDIR/$lv\"
+ lsof $SNAPDIR/$lv | sed 's/^/;;; /'
+ echo \";;; END lsof $SNAPDIR/$lv\"
+ if umount $SNAPDIR/$lv; then break; fi
+ sleep 2
+ done
rc=1
for i in 1 2 3 4; do
if lvremove -f $vg/$lv.bkp; then rc=0; break; fi
set -e
case $dryrun in
nil)
- hrfs=$(hash_file "$fshashdir/$fs.bkp")
- $log "remote fshash $HASH checksum: $hlfs"
+ hrfs=$(hash_file "new.fshash")
+ log "remote fshash $HASH checksum: $hrfs"
$verbose " done"
;;
t)
case $dryrun in
nil)
hlfs=$(hash_file "$localmap")
- $log "local fshash $HASH checksum: $hlfs"
+ log "local fshash $HASH checksum: $hlfs"
$verbose " done"
;;
t)