LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-26-2018, 07:31 AM   #1
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 507

Rep: Reputation: 36
LUKS drive cannot be unlocked anymore (produces "Invalid argument" error)


Hello.

I'm writing, because I have a rather interesting problem. I have an encrypted external drive, which I cannot unlock anymore. If I use Dolphin, it asks for the password as it should, bu then gives the following error:
Code:
An error occurred while accessing 'Home', the system responded: The requested operation has failed: Error unlocking /dev/sdb1: Failed to activate device: Invalid argument.
If I try to use udisksctl, I get a similar error:
Code:
Error unlocking /dev/sdb1: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error unlocking /dev/sdb1: Failed to activate device: Invalid argument
Being root or user doesn't make a difference. The last time I was able to unlock the drive was before a complete reinstall of my current machine (using Gentoo stable, kernel 4.14.65), so I'm not sure if some setting is missing or not right now.

So the question is: Does somebody know what this "Invalid argument" might be? Do you have some suggestions how this could be fixed?

Thanks in advance.

Last edited by pusrob; 08-27-2018 at 02:32 AM. Reason: Corrected typo in error message
 
Old 08-26-2018, 08:57 AM   #2
lougavulin
Member
 
Registered: Jul 2018
Distribution: Slackware,x86_64,current
Posts: 279

Rep: Reputation: 100Reputation: 100
Does your encrypted drive use lvm ? luks on lvm or lvm on luks ?

When you reinstall your current machine, do you setup with lvm and luks ?

Maybe can you let us know what is in your /etc/fstab ?
And if :
Code:
cryptsetup luksDump /dev/<your external drive>
answer correctly ?
 
Old 08-26-2018, 12:23 PM   #3
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 507

Original Poster
Rep: Reputation: 36
Thanks for the reply.

I forgot to mention, that the drive in question is external, connected via USB, so I have no entry in fstab for it. I don't recall having one before reinstall either, but my memory can of course lie. It is a simple LUKS drive, there is no LVM involved. The system doesn't use LUKS, as it uses something else, so the LUKS problem can be system setup/settings related.

The 'cryptsetup luksDump' doesn't show anything unusual either. Version, cipher name and mode, hash spec, etc. show normal values, and at least one key slot is enabled, so I don't think there is anything wrong with the drive. As I have said in the original post, it worked just fine before reinstall, so the problem must be on the system side I think.

Last edited by pusrob; 08-26-2018 at 12:26 PM.
 
Old 08-26-2018, 05:20 PM   #4
lougavulin
Member
 
Registered: Jul 2018
Distribution: Slackware,x86_64,current
Posts: 279

Rep: Reputation: 100Reputation: 100
I tried different things and nothing close to your problem.

So I'm sorry to ask, but did you try to mount it manually with crytpsetup ?
I mean :
Code:
cryptsetup luksOpen /dev/sd<??> externalluks [--key-file file.key]
mkdir /mnt/externalluks
mount /dev/mapper/externalluks /mnt/externalluks
As udisksctl and Dolphin are from other projects and packages, maybe something is missing from those packages.
udisksctl's message is strange, it refer to sdb1 and sdc1, two partition on two different physical disks...

And just to be sure about the external disk itself, do you have any way to mount it with another system ?
 
Old 08-27-2018, 02:31 AM   #5
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 507

Original Poster
Rep: Reputation: 36
Hi.

Sorry, the sdc1 vs sdb1 problem is a typo. All of them should be sdb1. I'll try the cryptsetup unlocking later this day, and I'll let you know the results. Thanks.
 
Old 08-27-2018, 02:20 PM   #6
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 507

Original Poster
Rep: Reputation: 36
Hi.

I tried the cryptsetup luksOpen command, and it gave me the first usable clue about what is wrong:
Code:
Cannot initialize device-mapper. Is dm_mod kernel module loaded?
As it turns out, the device mapper and dm_crypt weren't enabled in the kernel, so I did a quick recompile with these turned on. Now everything works as it should. I have no idea when and how these modules got disabled, but it doesn't matter now as the solution has been found.

Thanks for the help!

Last edited by pusrob; 08-27-2018 at 02:24 PM.
 
Old 01-26-2022, 08:47 PM   #7
Pentos
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Rep: Reputation: 0
Hi folks

IM having a similar problem but lack you guys proficiency.

I'm trying to access an encrypted partition on a USB HD (it used to be in a Linux Mint laptop that died)

I've tried running a LIVE version of Ubuntu to get into it, and have got as far as the password request but the old password doesn't work.
It returns an error message something to the effect,
"error unlocking device.....LUKS already exists."

Not sure if its significant, but it was a dual boot machine also running windoze, and the win partition seems to be corrupted.

Any ideas?

All help very gratefully received.
 
  


Reply

Tags
argument, failure, invalid, luks, unlock



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Valgrind is throwing error "failed in UME with error 22 (Invalid argument)." vamsi9042 Programming 1 11-06-2013 04:57 AM
clcok_get(CLOCK_MONOTONIC returns error "Invalid Argument" raghupv30 Linux - Kernel 1 11-19-2009 03:45 AM
Error while trying to mount NFS share: "Invalid argument" TheEvilHammer Linux - Software 2 11-12-2009 01:35 AM
"Invalid argument" error while mounting NFS partition montylee Programming 12 07-23-2009 12:36 PM
error: Error for wireless request "Set Mode" (8B06) : invalid argument "roaming" penguin chick Linux - Wireless Networking 5 08-22-2008 01:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration