help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to hook into mount during boot


From: Tristan Kohl
Subject: How to hook into mount during boot
Date: Wed, 3 Jan 2024 13:32:49 +0100
User-agent: Mozilla Thunderbird

Hey guys,

I wish you all a happy new year!

I am using Guix for a few months now and am in the process of migrating my home server.

The server hosts 5 drives which are LUKS-encrypted. The "keyfile" is at an offset into some small trailing free space of a specific thumb drive. Right now I boot up my server, plug in the drive and run following script as there is no /etc/crypttab which does this on other distributions. Luckily the server only needs a reboot every couple months. Still this process is quite inconvenient and imho defeats the idea of Guix' awesome configuration. Also I can not have my containers come up on boot.


#!/bin/sh

KEYFILE=/tmp/keyfile

dd if=/dev/disk/by-uuid/<UUID> of="$KEYFILE" bs=512 count=1 skip=<offset>

|cryptsetup open /dev/disk/by-uuid/<DISK1> --key-file "$KEYFILE" pool1|

|||cryptsetup open /dev/disk/by-uuid/<DISK2> --key-file "$KEYFILE" pool2|

|...|

|rm "$KEYFILE"
|

|btrfs device scan|

|mount /dev/mapper/pool1 /pool|


Since Guix does not currently support decryption via a keyfile from an external source I think this is my best bet right now. But how do I tell the system to run this so the pool drives are ready when Guix tries to mount?

Thank you very much for any help,
Tristan

|
|||



reply via email to

[Prev in Thread] Current Thread [Next in Thread]