-
Create empty file
dd if=/dev/urandom of=vaultfile.img bs=1M count=512
-
Create LUKS volume
cryptsetup --verify-passphrase luksFormat vaultfile.img
-
Open LUKS volume
sudo cryptsetup open --type luks vaultfile.img myvault
ls /dev/mapper
-
Create filesystem
sudo mkfs.ext4 -L myvault /dev/mapper/myvault
-
Close if needed
sudo cryptsetup close myvault
-
Start using
sudo cryptsetup open --type luks vaultfile.img myvault
ls /dev/mapper
sudo mkdir /myvault
sudo mount /dev/mapper/myvault /myvault
- Stop using
sudo umount /myvault
sudo cryptsetup close myvault