cp -a /src/. /dst/Preserve mode, ownership, timestamps, and symlinks.
Backup, copy, imaging, clone, and storage troubleshooting workflows on Linux.
Copy, archive, and sync data efficiently.
cp -a /src/. /dst/Preserve mode, ownership, timestamps, and symlinks.
Powerful local or remote copy preserving metadata and ACLs when supported.
rsync -aHAX --info=progress2 /src/ /dst/Powerful local or remote copy preserving metadata and ACLs when supported.
rsync -a --delete /src/ /dst/Make the destination match the source exactly.
rsync -aP /src/ user@host:/backup/Efficiently transfer deltas to a remote server.
tar -czf backup.tar.gz /dataPackage and compress a directory tree.
tar -xzf backup.tar.gz -C /restoreRestore archive contents to a target directory.
tar -tf backup.tar.gzInspect what an archive contains before extracting.
find . -print | cpio -ov > archive.cpioUseful in some initramfs and recovery workflows.
tar -cf - /data | pv | gzip > backup.tar.gzAdd transfer progress to streaming backup pipelines.
sha256sum backup.tar.gz > backup.tar.gz.sha256Record integrity hashes for backup artifacts.
Create raw images and clone or restore devices.
sudo dd if=/dev/sdb of=disk.img bs=64K status=progress conv=sync,noerrorImage a disk device to a raw file.
sudo dd if=disk.img of=/dev/sdb bs=64K status=progress conv=fsyncRestore a disk image onto a target device.
Preferred over dd for failing disks because it tracks progress and retries.
sudo ddrescue -f -n /dev/sdb disk.img disk.logPreferred over dd for failing disks because it tracks progress and retries.
sudo sgdisk --backup=gpt.backup /dev/sdbSave GPT headers and partition entries to a file.
sudo sgdisk --load-backup=gpt.backup /dev/sdbRestore GPT layout from a saved backup file.
qemu-img info disk.qcow2Show image format, virtual size, and backing file info.
qemu-img convert -O qcow2 disk.raw disk.qcow2Convert between raw, qcow2, and other image formats.
gzip -1 disk.imgCompress large raw images for storage or transfer.
xz -T0 disk.imgUse stronger compression for cold storage backups.
cmp disk1.img disk2.imgQuick equality check for cloned images of the same size.
Find hot paths, busy mounts, and performance or capacity problems.
Inspect per-device read/write rates and utilization over time.
iostat -xz 1Inspect per-device read/write rates and utilization over time.
sudo iotopFind which processes generate the most disk I/O.
pidstat -d 1Track read/write activity by process over time.
Quick check for iowait, swap, and block device pressure.
vmstat 1Quick check for iowait, swap, and block device pressure.
dmesg | egrep -i 'sd[a-z]|nvme|md|I/O error|ext4|xfs'Look for hardware and filesystem errors in kernel logs.
journalctl -k | egrep -i 'I/O error|blk_update_request|nvme|md'Kernel journal view for storage-related problems.
sudo ncdu /Find large paths interactively with a terminal UI.
find /var -xdev -type f -size +1G -printf '%s %p
' | sort -nLocate unexpectedly large files on a filesystem.
sudo lsof | grep '(deleted)'Useful when df is full but du cannot explain it.
sudo fstrim -avDiscard unused blocks on mounted SSD-backed filesystems.