Return-Path: Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Thu, 15 Feb 2018 15:56:22 +0100 (CET) Received: by mail-lf0-x242.google.com with SMTP id j193so18450760lfe.0 for ; Thu, 15 Feb 2018 06:56:22 -0800 (PST) Received: from localhost (user-94-254-224-125.play-internet.pl. [94.254.224.125]) by smtp.gmail.com with ESMTPSA id e21sm3205787lfb.51.2018.02.15.06.56.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 06:56:19 -0800 (PST) From: Mikhail Morfikov Message-ID: Date: Thu, 15 Feb 2018 15:56:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: [dm-crypt] How to attach a LUKS header to an encrypted container? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de I created an encrypted volume with the following command: cryptsetup luksFormat /dev/sdb1 \ --type luks2 \ --cipher aes-xts-plain64 \ --key-size 512 \ --hash sha512 \ --pbkdf argon2i \ --pbkdf-force-iterations 2 \ --pbkdf-memory 1048576 \ --pbkdf-parallel 1 \ --label some_label \ --subsystem "" \ --use-random \ --verify-passphrase \ --verbose \ --header /boot/luks/head.img So the header was created on the /boot/ partition instead of the sdb1 partition. The /boot/ partition is placed on a micro sd card, but unfortunately my laptop isn't able to boot from the sd card, and now I have to "reattach" the header to the encrypted partition. The question is how to do it properly, of course if it's doable at all? Will the "luksHeaderRestore" command be useful in this case, or do I have to do some magic to attach the header to the encrypted container? I checked what will happen when I issue the "luksHeaderRestore" command giving it the header file, but it gives me the following warning, and I don't know whether I should say "YES" to that question. WARNING! ======== Device /dev/sdb1 does not contain LUKS2 header. Replacing header can destroy data on that device. Are you sure? (Type uppercase yes):