Update partition.sh
This commit is contained in:
parent
c0a0a78181
commit
8f1553ce94
19
partition.sh
19
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
|
||||
|
|
Loading…
Reference in New Issue