- rsync for efficient file-level synchronization
- dd for creating bit-for-bit disk or partition images
Synchronizing Files with rsync
rsync (remote synchronization) efficiently copies and updates files between two locations, either locally or over SSH. It transfers only changes, saving bandwidth and time.
Basic Syntax
| Option | Description |
|---|---|
-a | Archive mode: preserves permissions, timestamps, symlinks, recursion |
-v | Verbose output |
-h | Human-readable numbers |
-P | Show progress and keep partially transferred files |
Always include a trailing slash on the source directory (
source/) to copy its contents rather than the directory itself.Examples
Sync local → remote:Creating Disk Images with dd
Thedd command performs a low-level copy of a disk or partition, producing an exact image file. This is ideal for full-system backups or forensic duplication.
Before imaging, unmount the target partition or disk to prevent data corruption:
Basic dd Command
| Option | Purpose |
|---|---|
if= | Input file (source disk/partition, e.g., /dev/vda) |
of= | Output file (destination image, e.g., diskimage.raw) |
bs= | Block size (e.g., 1M for faster transfer) |
status=progress | Display ongoing copy progress |
Sample Output
Restoring a Disk Image
To write the image back to a disk (this will overwrite the target):Ensure you specify the correct
of= target. Writing to the wrong device can destroy your data.Next Steps
Continue your journey in Linux file management:- Explore advanced
taroptions for incremental backups - Automate backups with
cronor systemd timers - Integrate encryption with
gpgor LUKS for secure archives