mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-24 14:51:03 +01:00
#296 added quick HDD size check
This commit is contained in:
parent
717c83b728
commit
4374497112
2 changed files with 35 additions and 1 deletions
|
@ -143,7 +143,7 @@ After this the setup process will need some time and the user will see a lot of
|
|||
|
||||
### Getting the Blockchain
|
||||
|
||||
*If you have a HDD with a prepared blockchain (e.g. a ready2go-set or you are at a workshop) you can kip to the [next chapter](README.md#setup-lightning). If you started with an empty HDD - you will see the following screen:*
|
||||
*If you have a HDD with a prepared blockchain (e.g. a ready2go-set or you are at a workshop) you can skip to the [next chapter](README.md#setup-lightning). If you started with an empty HDD - you will see the following screen:*
|
||||
|
||||
To get a copy of the blockchain, the RaspiBlitz offers the following options:
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo ""
|
||||
echo "*** Checking if HDD is connected ***"
|
||||
sleep 5
|
||||
device="sda1"
|
||||
existsHDD=$(lsblk | grep -c sda1)
|
||||
|
||||
if [ ${existsHDD} -eq 1 ]; then
|
||||
echo "OK - HDD found at sda1"
|
||||
|
||||
|
@ -28,6 +30,38 @@ if [ ${existsHDD} -eq 1 ]; then
|
|||
|
||||
fi
|
||||
|
||||
# quick basic size check
|
||||
echo ""
|
||||
echo "*** HDD Size Check ***"
|
||||
# bitcoin > 450 GB
|
||||
min1kblocks=450000000
|
||||
# litecoin > 190 GB
|
||||
if [ "${network}" = "litecoin" ]; then
|
||||
min1kblocks=190000000
|
||||
fi
|
||||
num1Kblocks=$(df | grep "dev/${device}" | awk '$1=$1' | cut -d " " -f 2)
|
||||
if [ ${num1Kblocks} -lt ${min1kblocks} ]; then
|
||||
if [ ${num1Kblocks} -gt 1 ]; then
|
||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
echo "WARNING: HDD might be too small"
|
||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
echo "You HDD was detected with the size of ${num1Kblocks}000 bytes"
|
||||
echo "For ${network} at least ${min1kblocks}000 bytes is recommended"
|
||||
echo "If you want to change to a bigger HDD:"
|
||||
echo "* Unplug power of RaspiBlitz"
|
||||
echo "* Make a fresh SD card again"
|
||||
echo "* Start again with bigger HDD"
|
||||
echo "If you want to try with HDD connected, press ENTER to continue."
|
||||
read key
|
||||
else
|
||||
echo "WARN: Was not able to get size of HDD ... skipping"
|
||||
sleep 3
|
||||
fi
|
||||
else
|
||||
echo "OK: HDD seems big enough"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
mountOK=$(df | grep -c /mnt/hdd)
|
||||
if [ ${mountOK} -eq 1 ]; then
|
||||
echo "FAIL - HDD is mounted"
|
||||
|
|
Loading…
Add table
Reference in a new issue