diff --git a/bash/fs.sh b/bash/fs.sh index 05ac088..005a56d 100644 --- a/bash/fs.sh +++ b/bash/fs.sh @@ -103,3 +103,19 @@ luks_format() { cryptsetup "${@}" luksFormat "${device}" 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 +}