mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-30 06:46:31 +00:00
fix(swarm-backup): make loop devices usable in the DR drill node
The node container has no udev, so LOOP_CTL_GET_FREE hands out a minor whose /dev node never appears; it also cannot load kernel modules, so those nodes stay dead unless the host carries the loop driver. Materialize the nodes, verify one can actually be attached, and expose the host prerequisite as a bootstrap step instead of failing three hours in with a cryptsetup message. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
8c7cdff6b6
commit
dcc1419ffa
4 files changed
+46
-1
No files matched your search
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
#
|
||||
# Load the kernel's loop driver so the swarm backup DR drill can attach its
|
||||
# simulated LUKS 'USB'. The drill runs inside a node container that has no
|
||||
# udev and cannot load modules itself: it materialises /dev/loopN with mknod,
|
||||
# but those nodes are dead until the driver is present on the host. Without
|
||||
# it cryptsetup aborts with "loop device with autoclear flag is required"
|
||||
# roughly three hours into a swarm round.
|
||||
#
|
||||
# Use `make kernel-loop-load` rather than calling this script directly.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
modprobe loop
|
||||
|
||||
if [ ! -c /dev/loop-control ]; then
|
||||
echo "FAILURE: /dev/loop-control absent after 'modprobe loop'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "loop driver ready: $(losetup -a | wc -l) device(s) currently attached"
|
||||
Reference in new issue
Block a user