Create filesystems on the mapped device, or continue to build complex storage structures using the mapped device
291
Tip
For more information, read the
dmsetup(8)
man page.
29.4.5. Create filesystems on the mapped device, or continue to
build complex storage structures using the mapped device
Use the mapped device node (
/dev/mapper/<name>
) as any other block device. To create an
ext2
filesystem on the mapped device, use the following command:
mke2fs /dev/mapper/<name>
To mount this filesystem on
/mnt/test
, use the following command:
Important
The directory
/mnt/test
must exist before executing this command.
mount /dev/mapper/<name> /mnt/test
29.4.6. Add the mapping information to
/etc/crypttab
In order for the system to set up a mapping for the device, an entry must be present in the
/etc/
crypttab
file. If the file doesn't exist, create it and change the owner and group to root (
root:root
)
and change the mode to
0744
. Add a line to the file with the following format:
<name> <device> none
The <device> field should be given in the form "UUID=<luks_uuid>", where <luks_uuid> is the LUKS
uuid as given by the command
cryptsetup luksUUID <device>
. This ensures the correct device
will be identified and used even if the device node (eg:
/dev/sda5
) changes.
Tip
For details on the format of the
/etc/crypttab
file, read the
crypttab(5)
man page.
29.4.7. Add an entry to
/etc/fstab
Add an entry to /etc/fstab. This is only necessary if you want to establish a persistent association
between the device and a mountpoint. Use the decrypted device,
/dev/mapper/<name>
in the
/
etc/fstab
file.
In many cases it is desirable to list devices in
/etc/fstab
by UUID or by a filesystem label. The
main purpose of this is to provide a constant identifier in the event that the device name (eg:
/dev/
sda4
) changes. LUKS device names in the form of
/dev/mapper/luks-<luks_uuid>
are based
Summary of Contents for ENTERPRISE LINUX 5 - VIRTUAL SERVER ADMINISTRATION
Page 12: ...xii ...
Page 20: ......
Page 30: ...12 ...
Page 32: ...14 ...
Page 82: ...64 ...
Page 106: ...88 ...
Page 122: ...104 ...
Page 124: ...106 ...
Page 126: ......
Page 132: ...114 ...
Page 168: ...150 ...
Page 182: ...164 ...
Page 192: ...174 ...
Page 194: ......
Page 236: ...218 ...
Page 238: ...220 ...
Page 270: ......
Page 274: ...256 ...
Page 278: ...260 ...
Page 292: ...274 ...
Page 294: ......
Page 300: ...282 ...
Page 304: ......
Page 316: ...298 ...
Page 370: ...352 ...
Page 384: ...366 ...
Page 385: ...Part VII Appendix ...
Page 386: ......