[Workaround found] Cannot mount LUKS partition after upgrade to mint 20

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
Stealps
Level 1
Level 1
Posts: 46
Joined: Wed Dec 20, 2017 7:07 pm

[Workaround found] Cannot mount LUKS partition after upgrade to mint 20

Post by Stealps »

I have encrypted storage

Code: Select all

$blkid
/dev/nvme0n1p6: UUID="<>" TYPE="crypto_LUKS" PARTUUID="<>"
And I'm mounting it to home with pam mount

Code: Select all

$less /etc/security/pam_mount.conf.xml
<volume user="dmitry" fstype="auto" path="/dev/nvme0n1p6" mountpoint="/home/dmitry" options="fsck,noatime"/>
After upgrading to mint 20 it stopped working. When I'm logging in with command line I see the error
(mount.c:72): messages from underlying mount program:
(mount.c:76): mount: /home/dmitry: unknown filesystem type 'crypto_LUKS'.
I see that libpam-mount package is still present in the system. How can I find out why it stopped understanding LUKS partitions?

Edited: found that 'lsmod' doesn't have dm_crypt module in a list, while package cryptsetup is installed
I can load it by sudo modprobe dm_crypt, but it doesn't solve the issue
Last edited by Stealps on Mon Jul 27, 2020 4:49 am, edited 1 time in total.
Stealps
Level 1
Level 1
Posts: 46
Joined: Wed Dec 20, 2017 7:07 pm

Re: Cannot mount LUKS partition after upgrade to mint 20

Post by Stealps »

Looks like partition can be mounted manually with luksOpen, it's just PAM doesn't work properly
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Cannot mount LUKS partition after upgrade to mint 20

Post by arvy »

Stealps wrote:
Thu Jul 16, 2020 4:08 am
it's just PAM doesn't work properly
Does this help?
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
Stealps
Level 1
Level 1
Posts: 46
Joined: Wed Dec 20, 2017 7:07 pm

Re: Cannot mount LUKS partition after upgrade to mint 20

Post by Stealps »

arvy wrote:
Thu Jul 16, 2020 4:33 am
Does this help?
It doesn't explain mount process... I mean PAM itself is working and trying to mount partition, but it's either doesn't decrypt it first, or mount command it executed cannot decrypt it in mint 20 for some reason.

Possible reason for an issue - /sbin/mount.crypto_LUKS is present in mint 19, and not present in mint 20

mount.crypto_LUKS is a symlink for mount.crypt, I copied it to mint 20 from mint 19, there are no errors now, but partition still not mounted.
I only see
pam_mount.c:522): mount of /dev/nvme0n1p6 failed
Stealps
Level 1
Level 1
Posts: 46
Joined: Wed Dec 20, 2017 7:07 pm

Re: Cannot mount LUKS partition after upgrade to mint 20

Post by Stealps »

How can I found out which package should generate /sbin/mount.crypt utility and why is that missing after update to mint 20?

mounting with cryptsetup luksOpen does work, but have to be performed manually, while pam using this single mount.crypt and that is missing. Simply copying the file from mint19 doesn't work, probably some configuration is missing, or it's device-specific (I have mint19 on another laptop). I cannot find related errors.
User avatar
Joe2Shoe
Level 5
Level 5
Posts: 541
Joined: Wed Oct 18, 2017 8:12 pm
Location: Ozone

Re: Cannot mount LUKS partition after upgrade to mint 20

Post by Joe2Shoe »

I upgraded from LM19.3 to LM20, and my LUKS partition works fine (encrypt and decrypt). But, my LUKS partition is on a separate (Data) partition, not on the OS partition.
As long as you know the location of the LUKS partition and you have the password for LUKS, then you should have no problems.
Point your LUKS Decrypt Script to the location of the LUKS partition (wherever that is).
I also have 3 LUKS encrypted USB Flash drives, and a LUKS decrypt script for each, and I can open either USB flash drive on any laptop that LUKS/cryptsetup is installed on.
You may need to reinstall cryptsetup.
Or copy your LUKS partition to a USB flash drive, then do a fresh install of LM20, as something may have gone South.
Good luck.
"Tolerance is the refuge of men without conviction."
"Common sense is not so common" - Voltaire
Stealps
Level 1
Level 1
Posts: 46
Joined: Wed Dec 20, 2017 7:07 pm

Re: Cannot mount LUKS partition after upgrade to mint 20

Post by Stealps »

Joe2Shoe wrote:
Thu Jul 16, 2020 9:31 pm
I upgraded from LM19.3 to LM20, and my LUKS partition works fine (encrypt and decrypt). But, my LUKS partition is on a separate (Data) partition, not on the OS partition.
As long as you know the location of the LUKS partition and you have the password for LUKS, then you should have no problems.
Point your LUKS Decrypt Script to the location of the LUKS partition (wherever that is).
I also have 3 LUKS encrypted USB Flash drives, and a LUKS decrypt script for each, and I can open either USB flash drive on any laptop that LUKS/cryptsetup is installed on.
You may need to reinstall cryptsetup.
Or copy your LUKS partition to a USB flash drive, then do a fresh install of LM20, as something may have gone South.
Good luck.
As mentioned above manual cryptsetup luksOpen works fine. And I did tried to reinstall it.
Just in mint20 PAM flow to open crypted partitions is broken, probably because /sbin/mount.crypt is missing now.

PAM allowing me to use login password to decrypt disk and mount partition during login stage, so I don't need to store key on a laptop neither type additional password during boot.
I don't know other way to achieve that.
Stealps
Level 1
Level 1
Posts: 46
Joined: Wed Dec 20, 2017 7:07 pm

Re: Cannot mount LUKS partition after upgrade to mint 20

Post by Stealps »

so /sbin/mount.crypt files are part of libpam-mount package in ubuntu 20.04.
Just checked in docker, the are appearing after installing this package.
reinstalled libpam-mount in mint 20, no errors in progress, but no utility files as well.
While version is the same - 2.16-10
Stealps
Level 1
Level 1
Posts: 46
Joined: Wed Dec 20, 2017 7:07 pm

Re: Cannot mount LUKS partition after upgrade to mint 20

Post by Stealps »

Anybody have any suggestions of how to proceed?
Stealps
Level 1
Level 1
Posts: 46
Joined: Wed Dec 20, 2017 7:07 pm

Re: Cannot mount LUKS partition after upgrade to mint 20

Post by Stealps »

Looks like since 20 those files are part of libpam-mount-bin package which is installed automatically with libpam-mount in ubuntu, but not in mint.
Post Reply

Return to “Installation & Boot”