From 74a9a97ca418b5bb2d6c26f96c82970497bdc5ec Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 31 Dec 2023 14:25:07 +0100 Subject: [PATCH] =?UTF-8?q?nvme-suffix=20geaddet.=20Bzip2.=20unterst=C3=BC?= =?UTF-8?q?tzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- installstick/platte_bespielen_btrfs.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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