Rsync takes really long, in SMR to CMR disk migration

From man cp:

       -R, -r, --recursive
              copy directories recursively

       -a, --archive
              same as -dR --preserve=all

       -v, --verbose
              explain what is being done

       -u, --update
              copy only when the SOURCE file is newer than the destination file or when the destination file is missing

from man rsync:

        -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
        -v, --verbose               increase verbosity
        -h, --human-readable        output numbers in a human-readable format
        -P                          same as --partial --progress
            --progress              show progress during transfer
            --partial               keep partially transferred files

The benefit from using cp instead of rsync for initial transfer is more faster processing of files (the cp command do not collect information regarding hashes of files and will transfer file as a whole piece, if it’s updated or doesn’t exist on destination), but you may mess it up, if you run it in the second and next times, because the cp -r may create another copy on destination instead of updating existing one, depending on how you provided the source and destination paths.

The last one

must be done anyway when the source node is stopped to remove wal and shm files for your databases, otherwise they may lead to databases corruption on start.

3 Likes