diff --git a/src/Core/Main.vala b/src/Core/Main.vala index a47a3aed..806c4735 100644 --- a/src/Core/Main.vala +++ b/src/Core/Main.vala @@ -2879,11 +2879,19 @@ public class Main : GLib.Object{ // check and add entries for mapped devices which are encrypted foreach(var mnt in mount_list){ - if ((mnt.device != null) && (mnt.device.parent != null) && (mnt.device.is_on_encrypted_partition())){ - + if ((mnt.device != null) && (mnt.device.parent != null) + && ((mnt.device.is_on_encrypted_partition()) + || ((mnt.device.parent.parent != null) && + (mnt.device.parent.is_on_encrypted_partition())))){ + + // We could be either directly on LUKS or on LVM-on-LUKS, + // so be sure to get the top-level LUKS UUID. + var crypt_parent = (mnt.device.is_on_encrypted_partition()) ? + mnt.device.parent.uuid : mnt.device.parent.parent.uuid; + // find existing var entry = CryptTabEntry.find_entry_by_uuid( - crypttab_list, mnt.device.parent.uuid); + crypttab_list, crypt_parent); // add if missing if (entry == null){ @@ -2892,8 +2900,8 @@ public class Main : GLib.Object{ } // set custom values - entry.device_uuid = mnt.device.parent.uuid; - entry.mapped_name = "luks-%s".printf(mnt.device.parent.uuid); + entry.device_uuid = crypt_parent; + entry.mapped_name = "luks-%s".printf(crypt_parent); entry.keyfile = "none"; entry.options = "luks,nofail"; }