Skip to content

Instantly share code, notes, and snippets.

@mullnerz
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mullnerz/661fab7d0b4ad275b4b0 to your computer and use it in GitHub Desktop.
Save mullnerz/661fab7d0b4ad275b4b0 to your computer and use it in GitHub Desktop.
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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment