<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Luks on Terminal</title><link>https://muisti.atk-neuvos.fi/tags/luks/</link><description>Recent content in Luks on Terminal</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 24 Mar 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://muisti.atk-neuvos.fi/tags/luks/index.xml" rel="self" type="application/rss+xml"/><item><title>LUKS basics</title><link>https://muisti.atk-neuvos.fi/posts/luks/</link><pubDate>Mon, 24 Mar 2025 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/luks/</guid><description>&lt;h1 id="prepare-storage-device-from-zero"&gt;Prepare storage device from zero&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;cryptsetup luksFormat /dev/sdx
cryptsetup luksOpen /dev/sdx cryptoblob
mkfs.ext4 /dev/mapper/cryptoblob
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="test-slotpassphrase"&gt;Test slot/passphrase&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;cryptsetup --verbose open --test-passphrase /dev/sdx
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="change-volume-password"&gt;Change volume password&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;cryptsetup luksChangeKey -S 0 /dev/sdx
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="update-old-luks-kdf-for-safer-one"&gt;Update old LUKS KDF for safer one&lt;/h1&gt;
&lt;p&gt;Older LUKS volumes can have unsafe/poor key derivation function in use.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;cryptsetup luksHeaderBackup /dev/sdx --header-backup-file /tmp/luksheader

cryptsetup luksDump /dev/sdx

# If type 1 (old):
cryptsetup convert /dev/sdx --type luks2
cryptsetup luksConvertKey /dev/sdx --pbkdf argon2id

# If goofen uppen, restore old header:
cryptsetup luksHeaderRestore /dev/sdx --header-backup-file /tmp/luksheader
&lt;/code&gt;&lt;/pre&gt;</description></item></channel></rss>