I've developed a solution to random crypted swap devices not having a UUID, at least for GPT (Guid Partition Tables).
The cryptswap partitions indeed don't have an ordinary UUID, but if they are GPT partitions, they do have a persistent PARTUUID (UUID assigned to partition) and are available through /dev/disk/by-partuuid/ .
I've developed a solution to random crypted swap devices not having a UUID, at least for GPT (Guid Partition Tables).
The cryptswap partitions indeed don't have an ordinary UUID, but if they are GPT partitions, they do have a persistent PARTUUID (UUID assigned to partition) and are available through /dev/disk/ by-partuuid/ .
Arch Linux guys have patched their cryptsetup functions to support this format: https:/ /patchwork. archlinux. org/patch/ 389/
I've applied similar approach to /lib/cryptsetup /cryptdisks. functions as seen in the patch below:
--- cryptdisks. functions. orig 2013-12-20 19:42:02.048667466 +0100 functions. olo.partuuid. 2013-12- 20 2013-12-20 19:49:37.876503582 +0100
src=" /dev/disk/ by-uuid/ ${src#UUID= }" /patchwork. archlinux. org/patch/ 389/ disk/by- partuuid/ ${src#PARTUUID= }"
src=" /dev/disk/ by-label/ ${src#LABEL= }" ]]*(#|$ )" "$TABFILE" | while read dst src key opts; do
src= "/dev/disk/ by-uuid/ ${src#UUID= }" $ID_PART_ ENTRY_UUID" = "x$src" ]; then /patchwork. archlinux. org/patch/ 389/ disk/by- partuuid/ ${src#PARTUUID= }"
elif [ "xLABEL= $ID_FS_ LABEL_ENC" = "x$src" ]; then
src= "/dev/disk/ by-label/ ${src#LABEL= }"
elif [ "x$1" != "x$src" ]; then
+++ cryptdisks.
@@ -488,6 +488,9 @@
# parse UUID= symlinks
if [ "${src#UUID=}" != "$src" ]; then
+ elif [ "${src#PARTUUID=}" != "$src" ]; then
+ # inspired by https:/
+ src="/dev/
elif [ "${src#LABEL=}" != "$src" ]; then
fi
@@ -599,6 +602,9 @@
egrep -v "^[[:space:
if [ "xUUID=$ID_FS_UUID" = "x$src" ]; then
+ elif [ "xPARTUUID=
+ # inspired by https:/
+ src="/dev/
This enables the following format for crypttab:
cryptswap1 PARTUUID= c352d0c2- 3584-44a1- 9de7-c2bfdb9c58 f8 /dev/urandom swap,cipher= aes-cbc- essiv:sha256
Obviously, this has to also be documented in crypttab manpage (man 5 crypttab).