How to encrypt an external removable USB attached disk with LUKS?

Mar 28, 2023
2
0
1
Steps to perform on proxmox VE (version 7.3-3):

Step 0: apt-get install cryptsetup
Step 1: fdisk /dev/sdb
Step 2: cryptsetup luksFormat /dev/sdb
Step 3: cryptsetup luksOpen /dev/sdb encrypted_disk
Step 4: mkfs.ext4 /dev/mapper/encrypted_disk
Step 5: mkdir /mnt/encrypted_disk
Step 6: mount /dev/mapper/encrypted_disk /mnt/encrypted_disk
Step 7: rsync avzh /data/ /mnt/encrypted_disk/
Step 8: umount /mnt/encrypted_disk
Step 9: cryptsetup luksClose encrypted_disk

Since this external disk (i.e. /dev/sdb) will be removed physically and I do not see any
reason involving /etc/fstab and/or /etc/crypttab files. when trying to re-use disk, I see
that I needed to repeated steps 3, 6, 7, 8 and 9. Thanks!
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!