Re: Bug: luksClose search LUKS header but it is detached

Milan Broz <[email protected]>
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
On 09/08/2022 23:53, [email protected] wrote:
> Hi all,
> 
> I noticed that cryptsetup LUKS extensions is searching for a LUKS
> header in the device.
> This is expected when the LUKS header should be in the device.
> But I used a detached LUKS header, so I wasn't expecting to see
> cryptsetup searching for the LUKS header in the device.
> 
> You can see that in the log file "log.txt" - in the URL:
> https://drive.google.com/file/d/1DcrpklgE75oE5znAxHAlp9CPikkYbVq1/view?usp=sharing
> 
> You may notice that I used a "--header" flag, but I also tried without
> it - still, cryptsetup behaved the same.
> 
> The incriminating lines from the attached log are as follows:

...
> Do you consider it to be a bug?

Hi,

No, this is expected. But for close (deactivation) it proceeds even
if it does not find the detached header.

The reason is that even close need some information from the header
(for example UUID).

Is there any functional problem with this or it just looks strange?

If it is problem, you can always use low-level access through
"dmsetup remove <device>" here, but it can keeps some underlying device
active (for LUKS2 this is used only for integrity protected devices).

Milan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.