Score:0

how to specify "take rest of space" to an lvm partition in autoinstall

za flag

When creating an autoinstall config file, I want an LVM partition to take the rest of the remaining free space (free space may be different on different installs so I can't hard code it and I'd rather not calculate as it's next to impossible to get it right and use all the space). I started with this in my autoinstall.yaml file:

    - id: lvm_partition_9
      name: lv9
      #size: 0
      type: lvm_partition
      volgroup: vg0

because "the fine manual" says to leave the "size" key out for it to take the remaining space. When I do that, autoinstall crashes and tells me it's missing the size parameter.

I've also tried having a size there like:

  • size: 0
  • size: -1
  • size: ''
  • size: 100%
  • size: 100%FREE

but none of those work, telling me invalid value in various ways. So how to I tell it to take the rest of the space left in the volume group?

FWIW, this is based off the Ubuntu-20.04.2 server image that I'm customizing. I think subiquity is build 2280.

Andrew Lowther avatar
jp flag
What error do you get with `100%`? I've used that successfully, but it did give me an error when using human readable values for the partition sizes. E.g. I had to use `536870912` instead of `512M`.
KBrannen avatar
za flag
@AndrewLowther It crashed again. Interesting that the crash file shows the expansion of the partition as "size: 115959922688B" at the top where it shows what it's about to be working on (CurtinConfig, that was autogenerated by SUbiquity). Then later it says "Volume group "vg0" has insufficient free space". So it didn't choke on "100%" this time, but what it did do based on that number is take the size of the entire disk (~120G) and try to use that ... not the size of the remaining **free** space.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.