cryptsetup close may emit confusing warning (it reads LUKS header from data area)
[root@machine ~]# cryptsetup luksFormat --type luks2 /dev/sdx
[root@machine ~]# cryptsetup luksFormat --type luks1 /dev/sdx --header detached-header
[root@machine ~]# cryptsetup open /dev/sdx --header detached-header xxxx
[root@machine ~]# cryptsetup close xxxx
Unsupported LUKS version 2.
[root@machine ~]# echo $?
0
We should not look for LUKS header in data area (ciphetext) of data device. This should be easily fixed by checking data offset of dm-crypt table.