Ubuntu preseed. Use whole disk space, but no swap
I'm trying to make a installation usb stick for a equipment we have here. I would like to automate linux installation, because we have a lot of these machines to install.
The machine has a 30GB SSD . I want preseed to use the entire disk to create an ext4 partition (mount point '/') and do not create a swap (it's a SSD, so no swap to avoid more read/write).
I read some blog's and articles on the internet where you define an expert_recipe to partman. But I wasn't able to find and option to say use the whole free space. There's the defaut option for partman but I believe (not sure of that) partman would create a swap partition.
How could I do that? Tell preseed to create a single partition using the entire disk and not create a swap partition ?
Solution 1:
partman
indeed creates swap partitions by default, unless you use the expert option.
The following expert_recipe creates a single root partition for the entire disk.
d-i partman-basicfilesystems/no_swap boolean false
d-i partman-auto/expert_recipe string myroot :: 1000 50 -1 ext4 \
$primary{ } $bootable{ } method{ format } \
format{ } use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
.
d-i partman-auto/choose_recipe select myroot
Line 1 disables the partman
warning about a missing swap partition.
Lines 2-6 create a single partition with a minimum size of 1000 MB. The -1
indicates the maximum size (infinite), which makes partman
grow the partition to the size of the disk.