Return-Path: Received: from nekare.kjorling.se (nekare.kjorling.se [89.221.249.175]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Wed, 23 Sep 2015 09:51:12 +0200 (CEST) Received: from yeono.kjorling.se (h-9-65.a328.priv.bahnhof.se [46.59.9.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "yeono", Issuer "yeono" (not verified)) by nekare.kjorling.se (Postfix) with ESMTPS id 76AD21140C5 for ; Wed, 23 Sep 2015 07:50:58 +0000 (UTC) Received: from yeono.kjorling.se (localhost [127.0.0.1]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by yeono (Postfix) with ESMTPS id 2DDDE14CD for ; Wed, 23 Sep 2015 09:50:58 +0200 (CEST) Date: Wed, 23 Sep 2015 07:50:56 +0000 From: Michael =?utf-8?B?S2rDtnJsaW5n?= Message-ID: <20150923075056.GA5504@yeono.kjorling.se> References: <20150922201950.GT14230@yeono.kjorling.se> <1499996308.43136.1442975395248.JavaMail.yahoo@mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1499996308.43136.1442975395248.JavaMail.yahoo@mail.yahoo.com> Subject: Re: [dm-crypt] How to recognize a LUKS container List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de On 23 Sep 2015 02:29 +0000, from hmccurdy@yahoo.com (H McCurdy): > 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. For the scenario you describe, something like # test -r $DEVICE && cryptsetup isLuks $DEVICE && echo It is LUKS is probably the best bet. -- 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)