Index: ecryptfs-utils-111/src/utils/ecryptfs-setup-swap =================================================================== --- ecryptfs-utils-111.orig/src/utils/ecryptfs-setup-swap +++ ecryptfs-utils-111/src/utils/ecryptfs-setup-swap @@ -168,6 +168,11 @@ for swap in $swaps; do if [ "$(blkid -p -s PART_ENTRY_SCHEME -o value "$swap")" = "gpt" ]; then drive="${swap%[0-9]*}" partno="${swap#$drive}" + # For NVMe and MMC drives, the above $partno will be correct, but we + # need to adjust $drive (LP: #1597154): + if echo $swap | grep -qE "^/dev/nvme*|^/dev/mmcblk*"; then + drive="${swap%p[0-9]*}" + fi if [ -b "$drive" ]; then if printf "x\np\n" | fdisk "$drive" | grep -q "^$swap .* GUID:.*\b63\b"; then echo "$swap is already marked as no-auto"