Portable Arch Linux: Backing Up and Restoring Your Drive with dd and rsync
estimated read time: 5 minutes
Why Back Up a Portable Drive
A portable Arch Linux install is a bespoke environment — your configs, tools, and setup exactly as you want them. Re-creating it from scratch is possible but painful. A backup is insurance.
There are two useful backup strategies for the Samsung T7:
-
Block-level image (
dd+zstd) — an exact bit-for-bit copy of the entire drive. Captures partition layout, bootloader, and all data. Restores are a single command. Best for disaster recovery: if the drive fails or gets corrupted, you can restore to a new one. -
Filesystem-level (
rsync) — copies files and directories with preserved metadata. Faster for incremental backups after the first run. Better for selective restores.
This article covers both, using WSL2 on Windows as the host environment since the T7 is often plugged into the Windows machine when not in use.
Method 1: Block Image via WSL2 (dd + zstd)
Prerequisites
- Samsung T7 connected to the Windows host
- WSL2 running (Ubuntu or any distro)
- Enough free space on your NAS or backup destination for the compressed image
Step 1 — Mount the T7 in WSL2
From an Administrator PowerShell window:
wsl --mount \\.\PHYSICALDRIVE3 --bare
Replace PHYSICALDRIVE3 with the correct drive number for your T7. To find it, run
Get-Disk in PowerShell and match by size.
Step 2 — Identify the device in WSL2
Open your WSL2 terminal:
lsblk
Output will look something like:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 388.4M 1 disk
sdb 8:16 0 186M 1 disk
sdc 8:32 0 8G 0 disk [SWAP]
sdd 8:48 0 931.5G 0 disk
├─sdd1 8:49 0 512M 0 part
├─sdd2 8:50 0 890G 0 part
└─sdd3 8:51 0 41G 0 part
sde 8:64 0 1T 0 disk /
Identify your T7 by size and partition structure. In this example it is sdd — a ~1TB drive with
an EFI partition, a root partition, and a smaller third partition.
Step 3 — Create the compressed image
Pipe dd output through zstd compression and write to your NAS:
sudo dd if=/dev/sdd bs=64M status=progress | zstd -T0 -1 | dd of=/mnt/nas/arch_t7_backup.img.zst bs=4M
- Replace
/dev/sddwith your actual device - Replace
/mnt/nas/arch_t7_backup.img.zstwith your destination path zstd -T0 -1uses all CPU threads at the fastest compression level — good balance of speed and size reduction
This will take a while depending on drive size. The progress output from dd gives you a rate estimate.
Restoring from the image
To restore to a replacement drive:
zstd -d -c /mnt/nas/arch_t7_backup.img.zst | sudo dd of=/dev/sdX bs=64M status=progress
Replace /dev/sdX with the target drive. This writes the full image back exactly as it was captured,
including partition table, bootloader, and all data.
⚠️ This will overwrite everything on the target drive. Double-check the device path before running.
Method 2: Filesystem-Level Backup with rsync
If you want incremental backups without re-writing the entire drive image each time, rsync is
the right tool. This backs up the filesystem contents rather than a raw block image.
This approach is also what powers the LUKS migration in
Article 2 — the same rsync command
can bootstrap a fresh encrypted partition from your existing install.
Mount the T7 partitions (assuming LUKS-encrypted root):
# From a live ISO or second Arch installation
cryptsetup open /dev/sdb2 cryptroot
mount /dev/mapper/cryptroot /mnt
mount /dev/sdb1 /mnt/boot
Run the backup:
sudo rsync -aAXHvx --info=progress2 \
--exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} \
/mnt/ /path/to/backup/
Flag reference:
| Flag | Purpose |
|---|---|
-a | Archive — preserves permissions, timestamps, ownership |
-A | Preserves Access Control Lists |
-X | Preserves extended attributes |
-H | Preserves hard links |
-x | Stays on the current filesystem — won’t cross mount boundaries |
--info=progress2 | Progress display with throughput and ETA |
The exclusions prevent copying virtual filesystems (/proc, /sys, /dev) and transient runtime
state (/tmp, /run) that should not be backed up.
Subsequent runs will only transfer changed files, making incremental backups fast.
Restoring with rsync
To restore to a freshly formatted partition:
sudo rsync -aAXHv --info=progress2 /path/to/backup/ /mnt/
Note the trailing slash on the source — this copies the contents of the backup directory, not the directory itself. After restoring, remember to regenerate the initramfs and update the bootloader UUID if you are restoring to a different physical device or partition.
Which Method to Use
dd block image | rsync filesystem | |
|---|---|---|
| First backup speed | Slow (full drive) | Medium |
| Incremental updates | ❌ Always full | ✅ Only changed files |
| Restore fidelity | Exact bit-for-bit | File-level (requires chroot after restore) |
| Restore to different drive size | ❌ Must be same or larger | ✅ Any size |
| Captures bootloader | ✅ Yes | ⚠️ Requires manual bootloader setup |
| Best for | Disaster recovery | Regular incremental backups |
A sensible strategy: take a dd image after major changes (LUKS setup, Secure Boot enrolment, big
config changes) and use rsync for regular incremental backups in between.
Portable Arch Linux Series
- Series Overview — Goals and Structure
- Article 1 — Setting Up Arch Linux on an External Drive (Coming Soon)
- Article 2 — Full Disk Encryption with LUKS2 and TPM2
- Article 3 — Secure Boot with sbctl
- Article 4 — Surviving BIOS Updates
- Article 5 — Backing Up and Restoring Your Drive ← you are here