Merge pull request 'use 'p' a partition table suffix if $DEV is NVME' (#73) from smu/Setup-Skripte:nvme into main

Reviewed-on: https://codeberg.org/Computertruhe/Setup-Skripte/pulls/73
Reviewed-by: B3rtl <b3rtl@noreply.codeberg.org>
Reviewed-by: Valentin Bachem <hdvalentin@noreply.codeberg.org>
This commit is contained in:
B3rtl 2023-11-10 07:38:19 +00:00
commit 1fc3684997
1 changed files with 7 additions and 1 deletions

View File

@ -67,6 +67,12 @@ echo "Warte 2 Sekunden vor dem löschen, abbrechen mit strg + c..."
sleep 2
echo "Achtung - vorbei, ich mache jetzt alles platt auf" "${DEV}"
NVME_PARTITION_SUFFIX=''
if [[ "$DEV" == *"nvme"* ]]; then
echo "$DEV is NVME device"
NVME_PARTITION_SUFFIX='p'
fi
case "$IMG" in
*.bz2)
sudo dd if="$IMG" bs=1M status=progress | bzip2 -d > "$DEV"
@ -77,7 +83,7 @@ case "$IMG" in
esac
sync
sudo growpart $DEV 3
sudo mount ${DEV}3 /mnt
sudo mount ${DEV}${NVME_PARTITION_SUFFIX}3 /mnt
sudo btrfs filesystem resize max /mnt
sudo umount /mnt
sync