recentpopularlog in

kme : luks   2

pipe - cryptsetup: Attaching loopback device failed - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
It seems that cryptsetup requires the LUKS header to be either regular file or device. If you need to provide the LUKS header as an output from a process/stream, you can easily circumvent the restriction by sending it to /dev/ram
<code class="language-bash">
cat LUKS-HEADER > /dev/ram0
</code>

(provided that your kernel supports ramdisk)

Then you can then simply use your cryptsetup command as:
<code class="language-bash">
cryptsetup luksOpen /dev/sdb1 sdb1 --header /dev/ram0
</code>

Keep in mind, the LUKS header will stay in /dev/ram0 disk until you free up the space. To free up the memory, you can use the blockdev command:
<code class="language-bash">
blockdev -v --flushbufs /dev/ram0
</code>
luks  crypto  blockdevices  linux  unix  sysadmin  tipsandtricks 
march 2019 by kme

Copy this bookmark:





to read