How to luks encrypt raid drive?
Edit: Turns out for what I’m trying to do (mount luks encrypted raid after start up) only needs the device mapping for the raid drive and not a file-system object.
So I luks encrypted the raid and call a script to open the vault and mount it when I need to.
In my system config file I added a raid drive like so:
<span style="color:#323232;">(mapped-devices (list (mapped-device
</span><span style="color:#323232;"> (source (uuid
</span><span style="color:#323232;"> "205e5caa-694f-4457-a2a1-8affa3536e75"))
</span><span style="color:#323232;"> (target "guix")
</span><span style="color:#323232;"> (type luks-device-mapping))
</span><span style="color:#323232;">
</span><span style="color:#323232;"> (mapped-device
</span><span style="color:#323232;"> (source (list "/dev/sdb1" "/dev/sdc1"))
</span><span style="color:#323232;"> (target "/dev/md0")
</span><span style="color:#323232;"> (type raid-device-mapping))))
</span><span style="color:#323232;">
</span><span style="color:#323232;">(file-systems (cons* (file-system
</span><span style="color:#323232;"> (mount-point "/")
</span><span style="color:#323232;"> (device "/dev/mapper/guix")
</span><span style="color:#323232;"> (type "ext4")
</span><span style="color:#323232;"> (dependencies (list (list-ref mapped-devices 0))))
</span><span style="color:#323232;">
</span><span style="color:#323232;"> (file-system
</span><span style="color:#323232;"> (mount-point "/mnt/nas")
</span><span style="color:#323232;"> (device "/dev/md0")
</span><span style="color:#323232;"> (type "ext4")
</span><span style="color:#323232;"> (mount? #f)
</span><span style="color:#323232;"> (dependencies (list (list-ref mapped-devices 1)))) %base-file-systems)))
</span>
I’d now like to luks encrypt the raid drive but I’m not sure how to go about doing it. Do I simply make a another mapped-device object, specifying the raid drive uuid and “/dev/md0” as the target:
<span style="color:#323232;">(mapped-device
</span><span style="color:#323232;"> (source (uuid
</span><span style="color:#323232;"> {raid uuid}))
</span><span style="color:#323232;"> (target "/dev/md0")
</span><span style="color:#323232;"> (type luks-device-mapping))
</span>
and then pass that as a dependency to the raid file system object?
Thanks
Add comment