fix: address review comments
This commit is contained in:
parent
e5b0fe6313
commit
647da12b43
|
@ -1168,7 +1168,7 @@ function PARTITIONING_DEVICES_label() {
|
||||||
|
|
||||||
if [[ "$invalid" -gt 0 ]]; then
|
if [[ "$invalid" -gt 0 ]]; then
|
||||||
echo " └ (${#PARTITIONING_DEVICES[@]} devices, \Z1$invalid invalid\Zn)"
|
echo " └ (${#PARTITIONING_DEVICES[@]} devices, \Z1$invalid invalid\Zn)"
|
||||||
elif [[ "${#PARTITIONING_DEVICES[@]}" -eq 1 && "$PARTITIONING_SCHEME" == "raid0_luks" || "$PARTITIONING_SCHEME" == "raid1_luks" ]]; then
|
elif [[ "${#PARTITIONING_DEVICES[@]}" -eq 1 && ("$PARTITIONING_SCHEME" == "raid0_luks" || "$PARTITIONING_SCHEME" == "raid1_luks") ]]; then
|
||||||
echo " └ (${#PARTITIONING_DEVICES[@]} devices, \Z1need at least 2\Zn)"
|
echo " └ (${#PARTITIONING_DEVICES[@]} devices, \Z1need at least 2\Zn)"
|
||||||
elif [[ "${#PARTITIONING_DEVICES[@]}" -eq 0 ]]; then
|
elif [[ "${#PARTITIONING_DEVICES[@]}" -eq 0 ]]; then
|
||||||
echo " └ (${#PARTITIONING_DEVICES[@]} devices, \Z1need at least 1\Zn)"
|
echo " └ (${#PARTITIONING_DEVICES[@]} devices, \Z1need at least 1\Zn)"
|
||||||
|
|
|
@ -276,6 +276,7 @@ function disk_create_raid() {
|
||||||
|
|
||||||
local devices_desc=""
|
local devices_desc=""
|
||||||
local devices=()
|
local devices=()
|
||||||
|
local extra_args=()
|
||||||
local id
|
local id
|
||||||
local dev
|
local dev
|
||||||
# Splitting is intentional here
|
# Splitting is intentional here
|
||||||
|
@ -291,31 +292,24 @@ function disk_create_raid() {
|
||||||
local mddevice="/dev/md/$name"
|
local mddevice="/dev/md/$name"
|
||||||
local uuid="${DISK_ID_TO_UUID[$new_id]}"
|
local uuid="${DISK_ID_TO_UUID[$new_id]}"
|
||||||
|
|
||||||
|
extra_args=()
|
||||||
if [[ ${level} == 1 ]]; then
|
if [[ ${level} == 1 ]]; then
|
||||||
einfo "Creating raid$level ($new_id) on $devices_desc"
|
extra_args+=("--metadata=1.0")
|
||||||
mdadm \
|
|
||||||
--create "$mddevice" \
|
|
||||||
--verbose \
|
|
||||||
--homehost="$HOSTNAME" \
|
|
||||||
--metadata=1.0 \
|
|
||||||
--raid-devices="${#devices[@]}" \
|
|
||||||
--uuid="$uuid" \
|
|
||||||
--level="$level" \
|
|
||||||
"${devices[@]}" \
|
|
||||||
|| die "Could not create raid$level array '$mddevice' ($new_id) on $devices_desc"
|
|
||||||
else
|
else
|
||||||
einfo "Creating raid$level ($new_id) on $devices_desc"
|
extra_args+=("--metadata=1.2")
|
||||||
mdadm \
|
|
||||||
--create "$mddevice" \
|
|
||||||
--verbose \
|
|
||||||
--homehost="$HOSTNAME" \
|
|
||||||
--metadata=1.2 \
|
|
||||||
--raid-devices="${#devices[@]}" \
|
|
||||||
--uuid="$uuid" \
|
|
||||||
--level="$level" \
|
|
||||||
"${devices[@]}" \
|
|
||||||
|| die "Could not create raid$level array '$mddevice' ($new_id) on $devices_desc"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
einfo "Creating raid$level ($new_id) on $devices_desc"
|
||||||
|
mdadm \
|
||||||
|
--create "$mddevice" \
|
||||||
|
--verbose \
|
||||||
|
--homehost="$HOSTNAME" \
|
||||||
|
"${extra_args[@]}" \
|
||||||
|
--raid-devices="${#devices[@]}" \
|
||||||
|
--uuid="$uuid" \
|
||||||
|
--level="$level" \
|
||||||
|
"${devices[@]}" \
|
||||||
|
|| die "Could not create raid$level array '$mddevice' ($new_id) on $devices_desc"
|
||||||
}
|
}
|
||||||
|
|
||||||
function disk_create_luks() {
|
function disk_create_luks() {
|
||||||
|
|
Loading…
Reference in New Issue