Author: Damian A. James Williamson (Willtech)
Privilege wrapper: groot by Willtech
AI collaborator: Microsoft Copilot (technical synthesis, procedural structuring)
This document describes a deterministic, reproducible, and compression‑assisted workflow for:
- Creating a consistent full‑disk backup of
/dev/nvme0n1 - Streaming it directly onto
/dev/sdausing gzip - Verifying the clone using SHA‑256 block hashing
- Restoring from
/dev/sdaback to the NVMe disk - Managing the lifecycle of a Btrfs snapshot used for consistency
All privileged operations use the Willtech privilege wrapper:
groot
This workflow is suitable for disaster recovery, disk migration, lineage‑clean archival, and reproducible system state capture.
A read‑only snapshot ensures the backup is consistent even while the system is running.
groot btrfs subvolume snapshot -r / /.snap-nvme-backupIf you want to inspect the snapshot:
groot mkdir -p /mnt/snap
groot mount -o ro,subvol=.snap-nvme-backup / /mnt/snapThis pipeline performs a compressed, block‑accurate clone directly between disks:
groot dd if=/dev/nvme0n1 bs=1M status=progress | gzip -1 | groot dd of=/dev/sda- Reads the entire NVMe disk
- Compresses the stream (
gzip -1= fastest compression) - Immediately decompresses it into
/dev/sda - No intermediate
.img.gzfile - Fully deterministic byte‑for‑byte clone
This is the cleanest possible “compressed disk teleport”.
Even though /dev/nvme0n1 is live, hashing raw blocks is safe and deterministic.
groot dd if=/dev/nvme0n1 bs=1M status=none | sha256sumgroot dd if=/dev/sda bs=1M status=none | sha256sumIf the hashes match, the clone is perfect.
You can restore using the same compressed pipeline:
groot dd if=/dev/sda bs=1M status=progress | gzip -1 | groot dd of=/dev/nvme0n1Or restore without compression:
groot dd if=/dev/sda of=/dev/nvme0n1 bs=1M status=progressBoth produce a byte‑accurate restoration of the entire disk.
If you mounted it:
groot umount /mnt/snapDelete the snapshot:
groot btrfs subvolume delete /.snap-nvme-backupConfirm removal:
groot btrfs subvolume list /Snapshot lifecycle complete.
# Optional: create Btrfs snapshot
groot btrfs subvolume snapshot -r / /.snap-nvme-backup
# Clone NVMe → SATA with gzip compression
groot dd if=/dev/nvme0n1 bs=1M status=progress | gzip -1 | groot dd of=/dev/sda
# Verify clone integrity
groot dd if=/dev/nvme0n1 bs=1M status=none | sha256sum
groot dd if=/dev/sda bs=1M status=none | sha256sum
# Restore (if needed)
groot dd if=/dev/sda bs=1M status=progress | gzip -1 | groot dd of=/dev/nvme0n1
# Clean up snapshot
groot btrfs subvolume delete /.snap-nvme-backup
# Optional: create Btrfs snapshot
groot btrfs subvolume snapshot -r / /.snap-nvme-backup
# (Optional) Mount snapshot for inspection
# NOTE: Snapshots are NOT mounted automatically. Depends on filesystem use CoPilot.
groot mkdir -p /mnt/snap
groot mount -o ro,subvol=.snap-nvme-backup /dev/nvme0n1p1 /mnt/snap
# Inspect snapshot contents under /mnt/snap
# (e.g., ls /mnt/snap, check configs, verify state, etc.)
# Clone NVMe → SATA using conv=sync,noerror
groot dd if=/dev/nvme0n1 of=/dev/sda bs=1M conv=sync,noerror status=progress
# Verify clone integrity
groot dd if=/dev/nvme0n1 bs=1M status=none | sha256sum
groot dd if=/dev/sda bs=1M status=none | sha256sum
# Restore (if needed)
groot dd if=/dev/sda of=/dev/nvme0n1 bs=1M conv=sync,noerror status=progress
# Clean up snapshot
groot btrfs subvolume delete /.snap-nvme-backup
To backup / to your backup device /mnt/backup.
groot rsync -aHAXx --info=progress2 --delete \
--numeric-ids --inplace --no-compress \
--exclude={"/dev/*","/proc/*","/sys/*","/run/*","/tmp/*","/mnt/*","/media/*","/lost+found"} \
/ /mnt/backup
Then run.
groot rsync -aHAXx --info=progress2 --delete \
--numeric-ids --inplace --no-compress \
--exclude={"/dev/*","/proc/*","/sys/*","/run/*","/tmp/*","/mnt/*","/media/*","/lost+found"} \
/home/{user} /mnt/backup/home/
- SecureWipe — https://github.com/Willtech/SecureWipe
- groot (Privilege Wrapper) — https://github.com/Willtech/groot
This document may be included in Willtech repositories under the same licensing terms as the parent project.