diff --git a/src/tm_mad/fs_lvm_ssh/mv b/src/tm_mad/fs_lvm_ssh/mv index 506edceda3e..9dd4f7ccd6b 100755 --- a/src/tm_mad/fs_lvm_ssh/mv +++ b/src/tm_mad/fs_lvm_ssh/mv @@ -110,19 +110,23 @@ EOF fi # copy volume between datastores - if [ "${SRC_PATH}" != "${DST_PATH}" ]; then + if [ "${SRC_PATH}" != "${DST_PATH}" ] || [ "${SRC_HOST}" != "${DST_HOST}" ]; then # create new volume CREATE_CMD=$(cat < /dev/null\\" | ${DD} if=- of=${DST_DEV}" + else + COPY_CMD="${DD} if=${SRC_DEV} of=${DST_DEV} bs=${DD_BLOCK_SIZE:-64k}" + fi + LOCK="tm-fs_lvm-${SRC_DS_SYS_ID}.lock" + exclusive "${LOCK}" 7200 ssh_exec_and_log "${DST_HOST}" "${COPY_CMD}" \ "Error copying ${SRC} to ${DST}" # delete old volume and update device symlinks