Re: How to recognize a LUKS container

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks everyone.  Since the issue was Ubuntu installer software not figuring it out, I was wondering about a way to solve the problem so that a program could figure it out (without human help).

I might have figured it out but can't test my idea until tomorrow.  My thought is to try to access it as if it exists and if the function returns -1, then it's not a valid LUKS container.  Anyway, that's my idea.

I might need to examine errno to make sure the error isn't something like EPERM.





On Tuesday, September 22, 2015 4:20 PM, Michael Kjörling <michael@xxxxxxxxxxx> wrote:


On 22 Sep 2015 22:03 +0200, from ralf+dm@xxxxxxxxxxxxxxxxxxxxxx (Ralf Ramsauer):
> - If you have a dump, you can also use the 'file' command
>
> Or the sophisticated one :-)
> - Look at the first few bytes of your partition/dump and check, if it
> contains the magic header "LUKS"

Or you can use 'file' directly, if you pass '-s' (--special-files) to it:

$ sudo file -s /dev/sdXY
/dev/sdXY: sticky LUKS encrypted file, ver 1 [aes, xts-plain64, sha512] UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
$

But I expect that 'cryptsetup isLuks' would be the best bet, as well
as lending itself better to automation (assuming of course that is the
end goal).

--
Michael Kjörling • https://michael.kjorling.se michael@xxxxxxxxxxx
OpenPGP B501AC6429EF4514 https://michael.kjorling.se/public-keys/pgp
                “People who think they know everything really annoy
                those of us who know we don’t.” (Bjarne Stroustrup)

_______________________________________________
dm-crypt mailing list
dm-crypt@xxxxxxxx
http://www.saout.de/mailman/listinfo/dm-crypt


_______________________________________________
dm-crypt mailing list
dm-crypt@xxxxxxxx
http://www.saout.de/mailman/listinfo/dm-crypt

[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux