Display Dialog before formatting HDD/SSD

This commit is contained in:
rootzoll 2020-01-15 20:43:42 +01:00
parent efd4cf7b59
commit 4925dba19c
3 changed files with 21 additions and 8 deletions

6
FAQ.md
View file

@ -833,3 +833,9 @@ There is an experimental script to connect the RaspiBlitz to a UPS over USB cabl
To turn it on run from terminal: `/home/admin/config.scripts/blitz.ups.sh on apcusb`
If you have other UPS models or ways to connect ... feel free to extend this script.
## How to recover a BTRFS partition?
This articles goes thru the usual options:
https://ownyourbits.com/2019/03/03/how-to-recover-a-btrfs-partition/
https://seravo.fi/2015/using-raid-btrfs-recovering-broken-disks

View file

@ -104,15 +104,22 @@ if [ ${hddGotBlockchain} -eq 0 ]; then
exit 1
fi
# now partition/format HDD
echo
echo "# --> Formatting HDD/SSD ..."
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh format ${format} ${hddCandidate})
if [ ${#error} -gt 0 ]; then
echo "# FAIL blitz.datadrive.sh format --> ${error}"
echo "# Please report issue to the raspiblitz github."
if (whiptail --title "FORMAT HDD/SSD" --yesno "The connected hard drive needs to get formatted.\nIMPORTANT: This will delete all data on that drive." 8 56); then
clear
echo "# --> Formatting HDD/SSD ..."
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh format ${format} ${hddCandidate})
if [ ${#error} -gt 0 ]; then
echo "# FAIL blitz.datadrive.sh format --> ${error}"
echo "# Please report issue to the raspiblitz github."
exit 1
fi
else
clear
echo "# Not formatting the HDD/SSD - Setup Process stopped."
echo "# Rearrange your hardware and retstart with a fresh sd card again."
exit 1
fi

View file

@ -138,10 +138,10 @@ if [ "$1" = "status" ]; then
sudo mkdir -p /mnt/storage
if [ "${hddFormat}" = "btrfs" ]; then
# in btrfs setup the second partition is storage partition
sudo mount /dev/${hdd}2 /mnt/storage
sudo mount /dev/${hdd}2 /mnt/storage 2>/dev/null
else
# in ext4 setup the first partition is also the storage partition
sudo mount /dev/${hdd}1 /mnt/storage
sudo mount /dev/${hdd}1 /mnt/storage 2>/dev/null
fi
isTempMounted=$(df | grep /mnt/storage | grep -c ${hdd})
if [ ${isTempMounted} -eq 0 ]; then