Skip to content

Instantly share code, notes, and snippets.

@tondrej
Created November 24, 2018 16:17
Show Gist options
  • Save tondrej/4b67777ea4884fbc17830314ab0f7d16 to your computer and use it in GitHub Desktop.
Save tondrej/4b67777ea4884fbc17830314ab0f7d16 to your computer and use it in GitHub Desktop.
backup.sh
#!/bin/bash
# http://errietta.me/blog/luks-clonezilla/
cryptsetup luksOpen /dev/sda5 crypt
modprobe dm-mod
vgchange -ay
partclone.ext4 -c -s /dev/sda1 -o ./sda1.img
tar -jcvf sda1.img.tar.bz2 sda1.img && rm sda1.img
partclone.ext4 -c -s /dev/mapper/mint--vg-root -o ./mint.img
tar -jcvf mint.img.tar.bz2 mint.img && rm mint.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment