a734c64bff58bda2fa48c2795453e092167b0ff7vboxsynccommand=$1 ; shift
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync echo Syntax: $0 /path/to/image/file command [args..]
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Set up image loop device
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncx=`losetup -f` ; losetup -r $x $imgfile ; imgloop=$x
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Create temporary file and set up temporary loop device
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Create snapshot device
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncx=`basename $imgfile` ; echo 0 $imgsize snapshot $imgloop $tmploop N 16 | \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Create symlink
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncx=$imgfile.cow ; ln -s /dev/mapper/$dmname $x ; cowlink=$x
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Wait until killed
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncecho "Created $cowlink"