From 8f1553ce9405d8501e086ccaf75a2828cce1a011 Mon Sep 17 00:00:00 2001 From: proledatarian Date: Sat, 12 Feb 2022 15:35:38 +0000 Subject: [PATCH] Update partition.sh --- partition.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/partition.sh b/partition.sh index 22b1a9a..13f56b7 100644 --- a/partition.sh +++ b/partition.sh @@ -15,24 +15,39 @@ declare -a disks # Select value on array. select disk in ${disks[*]} do + +# Separate values by spaces. IFS=' ' + +# Create new variable of selection. array=($disk) dev="${array[0]}" +echo -e -echo "Partitioning /dev/$dev." +# Starting partitioning. +echo "Partitioning /dev/$dev.." +echo -e + +# Clearing partition table of selected disk. echo "Clearing existing partitioning table." sgdisk -Z /dev/$dev && echo -e +# Creating boot partition. size="${array[1]%?}" echo "Creating boot partition of 256 MB." sgdisk -n 1:0:+256M /dev/$dev && echo -e +# Creating system partition. echo "Creating system partition of $size GB." sgdisk -n 2:0:0 /dev/$dev +echo -e +# Print partitions. echo "This is your new partition table:" -lsblk +lsblk | grep "$dev" + +# Exit. break done