mullnerz
9/4/2014 - 3:27 PM

Copy entire filesystem hierarchy from one hard drive to another (migrating data volumes)

Copy entire filesystem hierarchy from one hard drive to another (migrating data volumes)

rsync -avxHAXh --safe-links --numeric-ids /source /dest/

The options are:

  • -a : all files, with permissions, etc...
    archive mode; equals -rlptgoD (no -H,-A,-X)
  • -v : verbose, mention files
  • -x : stay on one file system
  • -H : preserve hard links (not included with -a)
  • -A : preserve ACLs/permissions (not included with -a)
  • -X : preserve extended attributes (not included with -a)
  • -h, --human-readable : output numbers in a human-readable format
  • --safe-links : Duplicate safe symlinks and skip unsafe ones.
    If --links is specified, then symlinks are recreated with the same target on the destination.
    Note that --archive implies --links.
    --links --safe-links : Duplicate safe symlinks and skip unsafe ones.
  • --numeric-ids : don't map uid/gid values by user/group name
  • --progress : show progress during transfer
    use only with network transfers, otherwise it slows down the process

Sources: