Format The Device As A Dm-Crypt/Luks Encrypted Device; Create A Mapping To Allow Access To The Device's Decrypted Contents - Red Hat ENTREPRISE LINUX 5 Installation Manual

Table of Contents

Advertisement

Chapter 29. Disk Encryption Guide

29.4.3. Format the device as a dm-crypt/LUKS encrypted device

Warning
The command below will destroy any existing data on the device.
cryptsetup luksFormat <device>
Tip
For more information, read the cryptsetup(8) man page.
After supplying the passphrase twice the device will be formatted for use. To verify, use the following
command:
cryptsetup isLuks <device> && echo Success
To see a summary of the encryption information for the device, use the following command:
cryptsetup luksDump <device>
29.4.4. Create a mapping to allow access to the device's decrypted
contents
To access the device's decrypted contents, a mapping must be established using the kernel device-
mapper.
It is useful to choose a meaningful name for this mapping. LUKS provides a UUID (Universally Unique
Identifier) for each device. This, unlike the device name (eg: /dev/sda3), is guaranteed to remain
constant as long as the LUKS header remains intact. To find a LUKS device's UUID, run the following
command:
cryptsetup luksUUID <device>
An example of a reliable, informative and unique mapping name would be luks-<uuid>, where
<uuid> is replaced with the device's LUKS UUID (eg: luks-50ec957a-5b5a-47ee-85e6-
f8085bbc97a8). This naming convention might seem unwieldy but is it not necessary to type it often.
cryptsetup luksOpen <device> <name>
There should now be a device node, /dev/mapper/<name>, which represents the decrypted device.
This block device can be read from and written to like any other unencrypted block device.
To see some information about the mapped device, use the following command:
dmsetup info <name>
290

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 5

Table of Contents