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:

  1. 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.

  2. 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

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

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:

FlagPurpose
-aArchive — preserves permissions, timestamps, ownership
-APreserves Access Control Lists
-XPreserves extended attributes
-HPreserves hard links
-xStays on the current filesystem — won’t cross mount boundaries
--info=progress2Progress 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 imagersync filesystem
First backup speedSlow (full drive)Medium
Incremental updates❌ Always full✅ Only changed files
Restore fidelityExact bit-for-bitFile-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 forDisaster recoveryRegular 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