From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nm2-vm6.bullet.mail.ne1.yahoo.com (nm2-vm6.bullet.mail.ne1.yahoo.com [98.138.91.254]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Wed, 23 Sep 2015 04:29:57 +0200 (CEST) Date: Wed, 23 Sep 2015 02:29:55 +0000 (UTC) From: H McCurdy Reply-To: H McCurdy Message-ID: <1499996308.43136.1442975395248.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <20150922201950.GT14230@yeono.kjorling.se> References: <20150922201950.GT14230@yeono.kjorling.se> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_43135_1569941306.1442975395245" Subject: Re: [dm-crypt] How to recognize a LUKS container List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Michael_Kj=C3=B6rling?= , "dm-crypt@saout.de" ------=_Part_43135_1569941306.1442975395245 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks everyone.=C2=A0 Since the issue was Ubuntu installer software not fi= guring it out, I was wondering about a way to solve the problem so that a p= rogram could figure it out (without human help). I might have figured it out but can't test my idea until tomorrow.=C2=A0 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.=C2=A0 Anyway, that's my idea. I might need to examine errno to make sure the error isn't something like E= PERM. =20 On Tuesday, September 22, 2015 4:20 PM, Michael Kj=C3=B6rling wrote: =20 On 22 Sep 2015 22:03 +0200, from ralf+dm@ramses-pyramidenbau.de (Ralf Rams= auer): > - If you have a dump, you can also use the 'file' command >=20 > 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] UUI= D: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx $=20 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). --=20 Michael Kj=C3=B6rling =E2=80=A2 https://michael.kjorling.se =E2=80=A2 micha= el@kjorling.se OpenPGP B501AC6429EF4514 https://michael.kjorling.se/public-keys/pgp =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=80=9CPeople who= think they know everything really annoy =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 those of us who kno= w we don=E2=80=99t.=E2=80=9D (Bjarne Stroustrup) _______________________________________________ dm-crypt mailing list dm-crypt@saout.de http://www.saout.de/mailman/listinfo/dm-crypt ------=_Part_43135_1569941306.1442975395245 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 hu= man help).

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

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


<= div id=3D"yui_3_16_0_1_1442975127966_2779">



On Tuesday, = September 22, 2015 4:20 PM, Michael Kj=C3=B6rling <michael@kjorling.se&g= t; wrote:


On 22= Sep 2015 22:03 +0200, from ralf+dm@ramses-py= ramidenbau.de (Ralf Ramsauer):
> - If you have a d= ump, you can also use the 'file' command
>
> Or the sophisticated one :-)
> - Look a= t 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, s= ha512] UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
$

But I expect that 'cryptsetup isLuks' woul= d be the best bet, as well
as lending itself better to au= tomation (assuming of course that is the
end goal).

--
Michael Kj=C3=B6rling= =E2=80=A2 https://michael.kjorling.se =E2=80=A2 mic= hael@kjorling.se
OpenPGP B501AC6429EF4514 https://michael.kjorling.se/public-keys/pgp
 =               =E2=80=9CPeople who thin= k they know everything really annoy
      =           those of us who know we don=E2=80=99t.= =E2=80=9D (Bjarne Stroustrup)

_______________________________________________
dm-crypt mailing list
dm-crypt@s= aout.de
http://www.saout.de/mailman/l= istinfo/dm-crypt


=
------=_Part_43135_1569941306.1442975395245--