I'm trying to install 20.04 with an auto install config file like this one:
user-data file:
version: 1
identity:
hostname: hostname
username: username
password: $crypted_pass
But the automated install process (leaving everything at defaults) does NOT partition the disk to use all space, even though that seems to be the default setting when I run through the installer manually.
After manually selecting all the defaults, I get this storage
section from /var/log/installer/autoinstall-user-data
storage:
config:
- {ptable: gpt, serial: INTEL SSDPEKKF256G8L_BTHH85121P8H256B, wwn: eui.5cd2e42c81a42d1d,
path: /dev/nvme0n1, wipe: superblock-recursive, preserve: false, name: '', grub_device: true,
type: disk, id: disk-nvme0n1}
- {device: disk-nvme0n1, size: 1048576, flag: bios_grub, number: 1, preserve: false,
type: partition, id: partition-0}
- {device: disk-nvme0n1, size: 256057016320, wipe: superblock, flag: '', number: 2,
preserve: false, type: partition, id: partition-1}
- {fstype: ext4, volume: partition-1, preserve: false, type: format, id: format-0}
- {device: format-0, path: /, type: mount, id: mount-0}
However, it's not clear to me what from here I need to include in my user-data file to just select the "fill disk" option?
Best Answer
I have not tried this, but the docs suggest a negative value will 'fill'.
Source: https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference#storage
edit
I tried this out. Using
size: -1
for the final partition did fill the disk. I tried usingsize: 100%
andsize: -1
for an LVM Logical Volume to use all the available space and it did not work. The installer errored inalign_down
insubiquity/models/filesystem.py
.I also tried
100%FREE
but subiquity errored ondehumanize_size
I also tried removing the size property for the
lvm_partition
because the curtin docs say (at https://curtin.readthedocs.io/en/latest/topics/storage.html)This does not work as subiquity errors if there is no
size
propertyThis is unfortunate as using a percentage for an LVM Volume would be a pretty basic use case
The full storage config I tried.
edit 2
I kept digging into this and it seems that sometimes subiquity stores disk sizes as a float, which led to the uncaught exception. I was actually able to work around this by not using human readable format. E.g. instead of
size: 512M
, usesize: 536870912
.This is a sample
storage
config that uses the autofill option with propertysize: -1
and also configures a logical volume to fill a volume group with the propertysize: 100%
It looks like the float bug may have been fixed with this commit and might be avoided if the automatic installer update feature is used
https://github.com/CanonicalLtd/subiquity/commit/8a84e470c59e292138482a0b1bd7144fbb4644db#diff-1ca44bce35f59e931cbe850119e630db