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