cryptsetup

Relabel a partition

Mount volume

  1. cryptsetup luksOpen /dev/sdxN <new-mapped-name>
  2. mount /dev/mapper/<new-mapped-name> /mount/point

Automounting

  1. Make a directory
    • mkdir /etc/luks_keys
  2. Create a random file
    • dd if=/dev/random of=/etc/luks_keys/key1 bs=32 count=1
  3. Add the key to the new file
    • cryptsetup luksAddKey /dev/sdxN /etc/luks_keys/key1
  4. Restore SELinux context
    • restorecon -vvRF /etc/luks_keys