Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
deb9:luks [2023/01/16 07:33] – [Encrypt volume] Bernard Condraudeb9:luks [2025/07/21 22:35] (current) – [Increase size of Raid Disk Array with LVM and LUKS] Bernard Condrau
Line 20: Line 20:
   - If you need a directory tree to be copied from a backup location back to the newly encrypted drive, do it with rsync<code>rsync -av --progress --exclude '/home/user/VirtualBox VMs' /home/user /mountpoint/</code>   - If you need a directory tree to be copied from a backup location back to the newly encrypted drive, do it with rsync<code>rsync -av --progress --exclude '/home/user/VirtualBox VMs' /home/user /mountpoint/</code>
   - Or, for an entire BackupPC structure<code>rsync -avxHAWX --info=progress2 /backup/ /new-backup/</code>   - Or, for an entire BackupPC structure<code>rsync -avxHAWX --info=progress2 /backup/ /new-backup/</code>
 +  - Verify the structure between source and destination<code>rsync -avcn /backup/ /new-backup/</code>
  
 ===== Increase size of Raid Disk Array with LVM and LUKS ===== ===== Increase size of Raid Disk Array with LVM and LUKS =====
Line 33: Line 34:
   - Mount file system:<code>mount /dev/mapper/vg_backup-lv_backup_crypt /backup</code>   - Mount file system:<code>mount /dev/mapper/vg_backup-lv_backup_crypt /backup</code>
   * You could do an online resize by avoiding to unmount the file system and closing LUKS, but I find this approach safer. If you decide to do an online resize, skip steps 2 and 3, and instead of step 6 (open LUKS) do a crypt resize:<code>cryptsetup resize vg_backup-lv_backup_crypt</code>.   * You could do an online resize by avoiding to unmount the file system and closing LUKS, but I find this approach safer. If you decide to do an online resize, skip steps 2 and 3, and instead of step 6 (open LUKS) do a crypt resize:<code>cryptsetup resize vg_backup-lv_backup_crypt</code>.
 +
 +===== Restore LUKS header =====
 +  sudo cryptsetup luksHeaderBackup /dev/mapper/vg_data2-lv_home --header-backup-file /path/to/backup/header.img
 +  sudo cryptsetup luksErase /dev/sdb1
 +  sudo cryptsetup luksHeaderRestore /dev/sdb1 --header-backup-file /path/to/backup/header.img
 +
 +https://superuser.com/questions/1596599/is-it-safe-to-move-a-luks-encrypted-partition-to-another-system-and-be-able-to-u
 +===== Links =====
 +  * [[https://bobcares.com/blog/raid-resync/]]
 +  * [[https://www.ducea.com/2009/03/08/mdadm-cheat-sheet/]]
 +  * [[https://unix.stackexchange.com/questions/546218/debian-full-disk-encryption-does-debian-installer-use-luks-1-or-2]]
 +  * [[https://www.lisenet.com/2013/install-luks-and-create-an-encrypted-luks-partition-on-debian/]]
 +  * [[https://www.lisenet.com/2013/install-luks-and-create-an-encrypted-luks-partition-on-debian/]]
 +  * [[https://www.cyberciti.biz/security/how-to-change-luks-disk-encryption-passphrase-in-linux/]]
 +  * [[https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories]]
 ===== Links ===== ===== Links =====
   * [[https://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/|How To: Linux Hard Disk Encryption With LUKS]]   * [[https://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/|How To: Linux Hard Disk Encryption With LUKS]]
Line 56: Line 72:
   * [[https://blog.tinned-software.net/create-a-luks-encrypted-partition-on-linux-mint/|Create a luks encrypted partition on Linux Mint]]   * [[https://blog.tinned-software.net/create-a-luks-encrypted-partition-on-linux-mint/|Create a luks encrypted partition on Linux Mint]]
   * [[https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption|dm-crypt/Swap encryption]]   * [[https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption|dm-crypt/Swap encryption]]
 +  * [[https://www.tecmint.com/clone-linux-partitions/|How to Clone a Partition or Hard drive in Linux]]
 +  * [[https://www.makeuseof.com/tag/2-methods-to-clone-your-linux-hard-drive/|How to Clone Your Linux Hard Drive: 4 Methods]]
 +  * [[https://smallbusiness.chron.com/clone-encrypted-hard-drive-57682.html|How to Clone an Encrypted Hard Drive]]
 +  * [[https://superuser.com/questions/1414795/cloning-hdd-containing-boot-and-lvm-to-new-hdd|Cloning HDD containing /boot and LVM to new HDD]]
 +  * [[https://roubert.name/joakim/migratetolargerdisks.html|Migrate Linux RAID 1+LVM System To Larger Disks HOWTO]]
 +  * [[https://www.linuxquestions.org/questions/slackware-14/create-software-raid1-on-one-disk-later-add-second-disk-4175449017/|create software raid1 on one disk, later add second disk?]]
 +  * [[https://www.linuxquestions.org/questions/fedora-35/how-to-resize-extend-a-volume-group-895429/|how to resize / extend a volume group]]
 +  * [[https://serverfault.com/questions/320310/how-to-resize-raid1-array-with-mdadm|How to resize RAID1 array with mdadm?]]
 +  * [[https://askubuntu.com/questions/944564/moving-raid-5-to-another-computer|Moving RAID 5 to another computer]]
 +  * [[https://superuser.com/questions/307541/copy-entire-file-system-hierarchy-from-one-drive-to-another|Copy entire file system hierarchy from one drive to another]]
 +  * [[https://forum.manjaro.org/t/how-to-clone-a-luks-encrypted-home-root-swap-partition-from-a-hdd-to-an-ssd/85741|How to clone a LUKS encrypted home/root/swap partition from a HDD to an SSD?]]