Frequently asked questions about LUKS encryption

This FAQ provides you with answers to common questions about LUKS encryption.

How do I unmount and secure data?

To unmount and secure LUKS-encrypted partition data run the following commands. In the example below, backup2 is the user given mapping name for the opened LUKS partition.
# umount /backup2
# cryptsetup luksClose backup2

How do I mount or remount encrypted partition?

To mount or remount LUKS-encrypted partition run the following commands. In the example below, backup2 is the user given mapping name for the opened LUKS partition.
# cryptsetup luksOpen /dev/xvdc backup2
# mount /dev/mapper/backup2 /backup2
# df -H
# mount

How do I change passphrase (password) for LUKS-encrypted partition?

To change the passphrase (or password) for LUKS-encrypted partition run the following commands.
# cryptsetup luksDump /dev/xvdc
# cryptsetup luksAddKey /dev/xvdc

Enter any passphrase:
Enter new passphrase for key slot:
Verify passphrase: