Skip to content

Instantly share code, notes, and snippets.

Last active December 28, 2022 14:07
What would you like to do?
Linux backup cheat sheet

Prepare (Ubuntu 22.04 Live):

sudo su
apt install pv

Dump disk (or partition) to local file

zstd < /dev/nvme0n1 | pv > laptop.img.zst

Dump disk (or partition) to compressed image over network (NAS)

zstd < /dev/nvme0n1 | pv | ssh adrien@ "cat > /volume1/Backup/laptop.img.zst"

Restore disk image from local file

zstd -dc laptop.img.zst | pv > /dev/nvme0n1

Restore disk image from NAS (untested)

ssh adrien@ "cat /volume1/Backup/laptop.img.zst" | pv | unzstd > /dev/nvme0n1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment