Partition

mkdir ~/backup; cd ~/backup
sfdisk -d /dev/sdx > sfdisk_dump
fdisk -l /dev/sda > fdisk_listing

LVM metadata backup

vgcfgbackup; cp /etc/lvm/backup/vg_groupname ~/backup

LUKS header

  1. locate partition(s) with luks using blkid fdisk -l 2>&1 | cut -d' ' -f1 | grep "\/dev" | while read line; do blkid -p $line | grep crypto | cut -d: -f1; done or using cryptsetup fdisk -l 2>&1 | cut -d' ' -f1 | grep "\/dev" | while read line; do cryptsetup isLuks $line; if [ $? = 0 ]; then echo "luks found on $line"; fi done

  2. actual backup cryptsetup luksHeaderBackup --header-backup-file luksHeaderBackup /dev/sdx#

NOTE: be sure to secure luksHeader by encrypting it using gpg -c luksHeaderBackup