§2023-07-31
Run the rsync command:
- The basic syntax for using rsync to copy a partition is as follows:
$ sudo rsync -av --progress --exclude excludePath /path/to/source_partition/ /path/to/destination_partition/
$ ?? sudo rsync -arv --progress --exclude excludePath /path/to/source_partition/ /path/to/destination_partition/
For example:
# rsync -av --progress /boot/* /mnt
# rsync -av --progress --exclude /mnt / /mnt/
$ sudo rsync -av --progress --exclude excludePath /path/to/source_partition/* /path/to/destination_partition/
Explanation of the options used:
- -a: Archive mode, which preserves permissions, ownership, timestamps, etc.
- -v: Verbose mode, which displays detailed output during the copy process.
- --progress: Shows the progress of the copy operation.
- --exlude exlude the excludePath
-v – Verbose output, displaying detailed information about the transfer.
-r – copies data recursively (but doesn’t preserve timestamps and permission while transferring data.
-a – archive mode, which allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships, and timestamps.
-z – Compress files during transfer to reduce network usage.
-h – human-readable, output numbers in a human-readable format.
-P – Show progress during the transfer.
SOURCE – Specifies the source file(s) or directory to be transferred, which can be a local or a remote location.
DESTINATION – Specifies the destination path where the files or directories will be copied. Similar to the source, it can be a local path or a remote location.