mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-25 07:07:46 +01:00
adding raid during setup
This commit is contained in:
parent
578dd42748
commit
6c0a6ba145
2 changed files with 36 additions and 1 deletions
|
@ -69,11 +69,17 @@ echo " OK"
|
||||||
echo
|
echo
|
||||||
echo "# --> Check HDD/SSD for Blockchain ..."
|
echo "# --> Check HDD/SSD for Blockchain ..."
|
||||||
echo "# hddGotBlockchain=${hddGotBlockchain}"
|
echo "# hddGotBlockchain=${hddGotBlockchain}"
|
||||||
|
raidDevice=$(echo "${raidCandidate[0]}" | cut -d " " -f 1)
|
||||||
|
raidSizeGB=$(echo "${raidCandidate[0]}" | cut -d " " -f 2)
|
||||||
|
echo "# raidCandidates=${raidCandidates}"
|
||||||
|
echo "# raidDevice='${raidDevice}'"
|
||||||
|
echo "# raidSizeGB=${raidSizeGB}"
|
||||||
if [ ${hddGotBlockchain} -eq 0 ]; then
|
if [ ${hddGotBlockchain} -eq 0 ]; then
|
||||||
|
|
||||||
# test feature: if there is a USB stick as a raid connected, then format in BTRFS an not in EXT4
|
# test feature: if there is a USB stick as a raid connected, then format in BTRFS an not in EXT4
|
||||||
format="ext4"
|
format="ext4"
|
||||||
if [ ${raidCandidates} -eq 1 ]; then
|
if [ ${raidCandidates} -eq 1 ]; then
|
||||||
|
|
||||||
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||||
echo "# EXPERIMENTAL FEATURE: BTRFS + RAID"
|
echo "# EXPERIMENTAL FEATURE: BTRFS + RAID"
|
||||||
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||||
|
@ -84,6 +90,19 @@ if [ ${hddGotBlockchain} -eq 0 ]; then
|
||||||
echo "# CTRL+C, remove device & call ./30initHDD.sh again."
|
echo "# CTRL+C, remove device & call ./30initHDD.sh again."
|
||||||
read key
|
read key
|
||||||
format="btrfs"
|
format="btrfs"
|
||||||
|
|
||||||
|
# check that raid cadidate is big enough
|
||||||
|
# a 32GB drive gets shown with 28GB in mby tests
|
||||||
|
if [ ${raidSizeGB} -lt 27 ]; then
|
||||||
|
echo "# FAIL the raid device needs to be at least a 32GB thumb drive."
|
||||||
|
echo "# Please remove or replace and call ./30initHDD.sh again"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ ${raidCandidates} -gt 1 ]; then
|
||||||
|
echo "# FAIL more then one USB raid drive candidate connected."
|
||||||
|
echo "# Please max one extra usb drive and the call ./30initHDD.sh again"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# now partition/format HDD
|
# now partition/format HDD
|
||||||
|
@ -96,6 +115,22 @@ if [ ${hddGotBlockchain} -eq 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# adding RAID drive
|
||||||
|
if [ "${format}" = "btrfs" ] && [ ${raidCandidates} -eq 1 ]; then
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "# --> Adding Raid Drive ..."
|
||||||
|
echo "# raidDevice='${raidDevice}'"
|
||||||
|
echo "# raidSizeGB=${raidSizeGB}"
|
||||||
|
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh raid on ${raidDevice})
|
||||||
|
if [ ${#error} -gt 0 ]; then
|
||||||
|
echo "# FAIL blitz.datadrive.sh raid on --> ${error}"
|
||||||
|
echo "# Please report issue to the raspiblitz github."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
echo "# OK"
|
echo "# OK"
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,7 @@ fi
|
||||||
if [ "$1" = "format" ] && [ "$2" = "ext4" ]; then
|
if [ "$1" = "format" ] && [ "$2" = "ext4" ]; then
|
||||||
|
|
||||||
# write new EXT4 partition
|
# write new EXT4 partition
|
||||||
>&2 echo "# Creating the one big partion"
|
>&2 echo "# Creating the one big partition"
|
||||||
sudo parted /dev/${hdd} mkpart primary ext4 0% 100% 1>/dev/null 2>/dev/null
|
sudo parted /dev/${hdd} mkpart primary ext4 0% 100% 1>/dev/null 2>/dev/null
|
||||||
sleep 6
|
sleep 6
|
||||||
sync
|
sync
|
||||||
|
|
Loading…
Add table
Reference in a new issue