diff --git a/installstick/platte_bespielen_btrfs.sh b/installstick/platte_bespielen_btrfs.sh index 66bcf1c..4af2525 100755 --- a/installstick/platte_bespielen_btrfs.sh +++ b/installstick/platte_bespielen_btrfs.sh @@ -19,14 +19,28 @@ echo "HDD dev angeben! z. B. /dev/hdc" exit 1 fi +NVME_PARTITION_SUFFIX='' +if [[ "$DEV" == *"nvme"* ]]; then + echo "$DEV is NVME device" + NVME_PARTITION_SUFFIX='p' +fi + echo "Warte 5 Sekunden vor dem löschen, abbrechen mit strg + c..." sleep 5 echo "Achtung - vorbei, ich mache jetzt alles platt auf" "${DEV}" -sudo dd if="$IMG" of=$DEV bs=1M status=progress +case "$IMG" in + *.bz2) + sudo dd if="$IMG" bs=1M status=progress | bzip2 -d > "$DEV" + ;; + *) + sudo dd if="$IMG" of=$DEV bs=1M status=progress + ;; +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