raid_create

This commit is contained in:
Marc Beninca 2024-11-13 14:24:58 +01:00
parent 8d53e86bcd
commit 2722134a0f
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -103,3 +103,19 @@ luks_format() {
cryptsetup "${@}" luksFormat "${device}" cryptsetup "${@}" luksFormat "${device}"
fi fi
} }
raid_create() {
if [ -n "${4}" ]; then
local name="${1}"
local uuid="${2}"
shift 2
mdadm \
--create "/dev/md/${name}" \
--level 0 \
--metadata 1 \
--name "md:${name}" \
--raid-devices ${#} \
--uuid "${uuid}" \
"${@}"
fi
}