-mount -o remount,ro "$mountpoint"
-trap "mount -o remount,rw $mountpoint; exit 12" 0
-cp -a -- "$mountpoint/." "$snmnt/."
+attempts=10
+while true; do
+ if mount -o remount,ro "$mountpoint"; then break; fi
+ attempts=$(( $attempts - 1 ))
+ if [ $attempts = 0 ]; then
+ echo >&2 'cannot remount readonly'
+ exit 1
+ fi
+ sleep 1
+done
+trap "set +e; mount -o remount,rw $mountpoint; exit 12" 0
+echo ' source remounted readonly, copying...'
+cp -ax -- "$mountpoint/." "$snmnt/."
+echo ' finalising...'