Skip to content

Commit 4b64382

Browse files
committed
encrypted: improve crypttab documentation
Closes #31
1 parent b921ee4 commit 4b64382

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

_docs/installation/partitioning/encrypted.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,25 @@ and wish to enable TRIM, you will also want to add `discard` like `luks,discard`
217217

218218
For full list of options, please refer to `man 5 crypttab`.
219219

220-
In any case:
220+
For the device, it is not recommended to use raw `/dev/sdX` or similar as
221+
that name may not be stable, particularly if you have multiple disks of the
222+
same type (SATA or NVMe). In setups with only one such disk (e.g. a laptop
223+
with a single NVMe stick) it is fine; in other cases, there are multiple
224+
better options.
225+
226+
When using the GPT partition table, it is recommended to label your partitions.
227+
Then you can use the partition label and achieve the best clarity:
221228

222229
```
223-
# echo crypt /dev/sda3 none luks > /etc/crypttab
230+
# echo crypt PARTLABEL=root none luks
224231
```
225232

226-
You might also want to use a UUID (`/dev/disk/by-uuid/...` or partlabel-based path
227-
instead of direct device path, in order to make it static. For this example this
228-
is okay though.
233+
For both GPT and other partition table types, `PARTUUID` is also an option.
234+
Additionally, UUID is an option as the Linux kernel will generate one for
235+
LUKS just like it does for file systems.
236+
237+
You can find out the specific label or UUID string by looking at the symlinks
238+
in `/dev/disk/by-partlabel` or similar.
229239

230240
### LUKS and initramfs
231241

0 commit comments

Comments
 (0)