mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-28 16:58:03 +01:00
Merge pull request #4152 from Schnitzel/dev
handle nvme drives when using ext4
This commit is contained in:
commit
e670e61297
1 changed files with 7 additions and 2 deletions
|
@ -717,6 +717,11 @@ if [ "$1" = "format" ]; then
|
||||||
|
|
||||||
# formatting old: EXT4
|
# formatting old: EXT4
|
||||||
if [ "$2" = "ext4" ]; then
|
if [ "$2" = "ext4" ]; then
|
||||||
|
if [ $(echo "${hdd}" | grep -c "nvme") = 0 ]; then
|
||||||
|
nvp=""
|
||||||
|
else
|
||||||
|
nvp="p"
|
||||||
|
fi
|
||||||
# prepare temp mount point
|
# prepare temp mount point
|
||||||
mkdir -p /tmp/ext4 1>/dev/null
|
mkdir -p /tmp/ext4 1>/dev/null
|
||||||
if [ $ext4IsPartition -eq 0 ]; then
|
if [ $ext4IsPartition -eq 0 ]; then
|
||||||
|
@ -733,7 +738,7 @@ if [ "$1" = "format" ]; then
|
||||||
>&2 echo "# waiting until the partition gets available"
|
>&2 echo "# waiting until the partition gets available"
|
||||||
sleep 2
|
sleep 2
|
||||||
sync
|
sync
|
||||||
loopdone=$(lsblk -o NAME | grep -c ${hdd}1)
|
loopdone=$(lsblk -o NAME | grep -c ${hdd}${nvp}1)
|
||||||
loopcount=$(($loopcount +1))
|
loopcount=$(($loopcount +1))
|
||||||
if [ ${loopcount} -gt 10 ]; then
|
if [ ${loopcount} -gt 10 ]; then
|
||||||
>&2 echo "# partition failed"
|
>&2 echo "# partition failed"
|
||||||
|
@ -754,7 +759,7 @@ if [ "$1" = "format" ]; then
|
||||||
fi
|
fi
|
||||||
>&2 echo "# Formatting"
|
>&2 echo "# Formatting"
|
||||||
if [ $ext4IsPartition -eq 0 ]; then
|
if [ $ext4IsPartition -eq 0 ]; then
|
||||||
mkfs.ext4 -F -L BLOCKCHAIN /dev/${hdd}1 1>/dev/null
|
mkfs.ext4 -F -L BLOCKCHAIN /dev/${hdd}${nvp}1 1>/dev/null
|
||||||
else
|
else
|
||||||
mkfs.ext4 -F -L BLOCKCHAIN /dev/${hdd} 1>/dev/null
|
mkfs.ext4 -F -L BLOCKCHAIN /dev/${hdd} 1>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue