iankelling.org
/
git
/
automated-distro-installer
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4a45eef
)
make raid1 default over raid0
author
Ian Kelling
<iank@fsf.org>
Mon, 8 Apr 2019 23:53:46 +0000
(19:53 -0400)
committer
Ian Kelling
<iank@fsf.org>
Mon, 8 Apr 2019 23:53:46 +0000
(19:53 -0400)
fai/config/hooks/partition.DEFAULT
patch
|
blob
|
history
diff --git
a/fai/config/hooks/partition.DEFAULT
b/fai/config/hooks/partition.DEFAULT
index 9ab73b22cceb9a2f91f2932b1c2c864f948484b0..d896a94d6e2e67a441e32e3446c0f16411b43bfe 100755
(executable)
--- a/
fai/config/hooks/partition.DEFAULT
+++ b/
fai/config/hooks/partition.DEFAULT
@@
-48,6
+48,7
@@
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
#
# RAID0: forces raid0 filesystem. Normally with 4+ devices, we use
# raid10.
#
# RAID0: forces raid0 filesystem. Normally with 4+ devices, we use
# raid10.
+# RAID1: forces raid1 filesystem.
if [[ $SPECIAL_DISK ]]; then
export CLASS_REPARTITION=true
if [[ $SPECIAL_DISK ]]; then
export CLASS_REPARTITION=true
@@
-235,8
+236,10
@@
for dev in ${devs[@]}; do
fi
done
fi
done
-if ifclass RAID0 || (( ${#boot_devs[@]}
< 4
)); then
+if ifclass RAID0 || (( ${#boot_devs[@]}
== 1
)); then
raid_level=0
raid_level=0
+elif ifclass RAID1 || (( ${#boot_devs[@]} <= 3 )); then
+ raid_level=1
else
raid_level=10
# need double the space if we are raid 10, and then
else
raid_level=10
# need double the space if we are raid 10, and then
@@
-270,6
+273,7
@@
first_boot_dev=${boot_devs[0]}
bpart() { # btrfs a partition
case $raid_level in
0) mkfs.btrfs -f $@ ;;
bpart() { # btrfs a partition
case $raid_level in
0) mkfs.btrfs -f $@ ;;
+ 1) mkfs.btrfs -f -m raid1 -d raid1 $@ ;;
10) mkfs.btrfs -f -m raid10 -d raid10 $@ ;;
esac
}
10) mkfs.btrfs -f -m raid10 -d raid10 $@ ;;
esac
}