For both a new Gentoo installation and encryption of an existing
/etc/fstab file needs to be checked and updated as needed.
This is apparently required for a new installation because the default
/etc/fstab in stage3 is just a template. But for an existing installation,
because the file system has been recreated on the LUKS partition, its partition
identifiers – including but are not limited to its UUID – are changed, so an
/etc/fstab is needed too. Even if the block device name is used in
/etc/fstab to identify the partition, the block device for the file system is
also changed after LUKS configuration from
for example, so an update is still necessary.
When updating the content of
/etc/fstab, please make sure that the new
partition identifier (i.e. the first field in a line) is for the file system
on the LUKS partition rather than the LUKS partition itself. The LUKS
partition is just like an encrypted container for other partitions; it cannot
be mounted directly. Instead, the file system on the LUKS partition ultimately
stores the system files.
The file system’s UUID can be retrieved using the
blkid command, with the
LUKS partition’s mapping device node under
/dev/mapper as the argument:
# blkid /dev/mapper/gentoo /dev/mapper/gentoo: UUID="f50a9ad7-a0fc-4e77-9d34-5b98823958ab" BLOCK_SIZE="4096" TYPE="ext4"
In this example, the UUID is
- UUID=5b91813d-554e-47af-b803-6799c94f8ee5 / ext4 noatime 0 1 + UUID=f50a9ad7-a0fc-4e77-9d34-5b98823958ab / ext4 noatime 0 1
The new block device identifier for the file system on the LUKS partition is
determined by the name specified in
If the name is
gentoo, then the new block device for the file system is
- /dev/sda2 / ext4 noatime 0 1 + /dev/mapper/gentoo / ext4 noatime 0 1
If a new Gentoo installation is being performed, then please follow the instructions in the following Handbook chapters: