From: H McCurdy <hmccurdy@yahoo.com>
To: "Michael Kjörling" <michael@kjorling.se>,
"dm-crypt@saout.de" <dm-crypt@saout.de>
Subject: Re: [dm-crypt] How to recognize a LUKS container
Date: Wed, 23 Sep 2015 02:29:55 +0000 (UTC) [thread overview]
Message-ID: <1499996308.43136.1442975395248.JavaMail.yahoo@mail.yahoo.com> (raw)
In-Reply-To: <20150922201950.GT14230@yeono.kjorling.se>
[-- Attachment #1: Type: text/plain, Size: 1731 bytes --]
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@kjorling.se> wrote:
On 22 Sep 2015 22:03 +0200, from ralf+dm@ramses-pyramidenbau.de (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@kjorling.se
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@saout.de
http://www.saout.de/mailman/listinfo/dm-crypt
[-- Attachment #2: Type: text/html, Size: 3755 bytes --]
next prev parent reply other threads:[~2015-09-23 2:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 18:52 [dm-crypt] How to recognize a LUKS container H McCurdy
2015-09-22 20:03 ` Ralf Ramsauer
2015-09-22 20:14 ` Ralf Ramsauer
2015-09-22 20:19 ` Michael Kjörling
2015-09-23 2:29 ` H McCurdy [this message]
2015-09-23 7:50 ` Michael Kjörling
2015-09-23 8:39 ` Milan Broz
2015-09-22 20:13 ` Arno Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1499996308.43136.1442975395248.JavaMail.yahoo@mail.yahoo.com \
--to=hmccurdy@yahoo.com \
--cc=dm-crypt@saout.de \
--cc=michael@kjorling.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.