From fca148bbd8c742c576e37e251628d2b6b28dc1c9 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 29 Nov 2021 10:47:16 +0100 Subject: [PATCH] ask the user for the swap size --- scripts/format-disk.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/format-disk.sh b/scripts/format-disk.sh index ac8ef99..0a1e0a0 100644 --- a/scripts/format-disk.sh +++ b/scripts/format-disk.sh @@ -1,6 +1,7 @@ -# Print the drives +# Print the drives and get user input parted -l read -p "Which disk do you want to format?: " drive_path +read -p "How large should the swap partition be (in GiB)?: " swap_size # Create partition table parted $drive_path -- mklabel gpt # Create EFI partition @@ -18,7 +19,7 @@ cryptsetup open $main_partition cryptlvm pvcreate /dev/mapper/cryptlvm vgcreate MainGroup /dev/mapper/cryptlvm # Create the swap volume -lvcreate -L 8G MainGroup -n swap +lvcreate -L ${swap_size}G MainGroup -n swap # Create the main volume lvcreate -l 100%FREE MainGroup -n root