X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fscripts%2Flfs_migrate;h=e9c8aaeddec4a9f7efac364ad6740accb4cb3293;hp=bf595b33729b4bd669eced24e7d0125f04e19288;hb=22b128497ac26e6f722270ad9047fd55a40ffa9f;hpb=2b23ad0d183141dc25377f2d37de6e6e36ba1169 diff --git a/lustre/scripts/lfs_migrate b/lustre/scripts/lfs_migrate index bf595b3..e9c8aae 100755 --- a/lustre/scripts/lfs_migrate +++ b/lustre/scripts/lfs_migrate @@ -147,16 +147,17 @@ lfs_migrate() { 2> /dev/null) [ -z "$COUNT" -o -z "$SIZE" ] && UNLINK="" + SIZE=${LFS_SIZE_OPT}${SIZE} fi # first try to migrate inside lustre # if failed go back to old rsync mode if [[ $RSYNC_MODE == false ]]; then - $LFS migrate -c${COUNT} ${LFS_SIZE_OPT}${SIZE} $OLDNAME - if [[ $? == 0 ]]; then + if $LFS migrate -c${COUNT} ${SIZE} "$OLDNAME"; then $ECHO "done" continue else + echo "falling back to rsync-based migration" RSYNC_MODE=true fi fi @@ -167,8 +168,7 @@ lfs_migrate() { continue fi - [ "$UNLINK" ] && $LFS setstripe -c${COUNT} \ - ${LFS_SIZE_OPT}${SIZE} "$NEWNAME" + [ "$UNLINK" ] && $LFS setstripe -c${COUNT} ${SIZE} "$NEWNAME" # we use --inplace, since we created our own temp file already if ! $RSYNC -a --inplace $RSYNC_OPTS "$OLDNAME" "$NEWNAME";then