Unable to create extended partition using the remainder of the disk space

Bug #1989977 reported by Fabio Augusto Miranda Martins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
Fix Released
High
Olivier Gayot

Bug Description

If you want to use the msdos partition table with more than 4 partitions, it is required to create 3 primary partitions + 1 extended partition + X logical partitions.

There is a problem when creating the extended partition, that if you don't specify a size, the installation fails with:

yaml: https://pastebin.ubuntu.com/p/dgTWBwkFmj/
Error: https://pastebin.ubuntu.com/p/qb68W6CPFn/

So, I tried to specify the size as -1, given that I want to create the extended partition with all disk space that I have left, so then I create the logical partitions, but this fails complaining that the partition has negative size but is not final partition of Disk:

yaml: https://pastebin.ubuntu.com/p/HXrkFCZB8p/
Error: https://pastebin.ubuntu.com/p/3Sk4FdsQ8c/

It works well if I specify the size of the extended partition in GB (which is not what I want):

yaml: https://pastebin.ubuntu.com/p/yPPqS4qWVc/

Dan Bungert (dbungert)
Changed in subiquity:
assignee: nobody → Dan Bungert (dbungert)
importance: Undecided → High
status: New → Triaged
tags: added: foundations-todo
Dan Bungert (dbungert)
Changed in subiquity:
assignee: Dan Bungert (dbungert) → Olivier Gayot (ogayot)
Olivier Gayot (ogayot)
Changed in subiquity:
status: Triaged → In Progress
Revision history for this message
Olivier Gayot (ogayot) wrote :

Pasting the config that we expect Subiquity to accept once it is fixed ; just in case the pastebin expires. Source: https://pastebin.ubuntu.com/p/HXrkFCZB8p/

storage:
      config:
        - type: disk
          ptable: msdos
          wipe: superblock-recursive
          path: /dev/vda
          grub_device: true
          id: disk-1

        - type: partition
          number: 1
          flag: boot
          device: disk-1
          size: 1G
          wipe: superblock
          id: partition-boot
        - type: format
          fstype: ext4
          volume: partition-boot
          id: format-boot
        - type: mount
          path: /boot
          device: format-boot
          id: mount-boot

        - type: partition
          number: 2
          device: disk-1
          size: 20G
          wipe: superblock
          id: partition-root
        - type: format
          fstype: ext4
          volume: partition-root
          id: format-root
        - type: mount
          path: /
          device: format-root
          id: mount-root

        - type: partition
          number: 3
          device: disk-1
          size: 16G
          wipe: superblock
          id: partition-swap
        - type: format
          fstype: swap
          volume: partition-swap
          id: format-swap
        - type: mount
          path: "none"
          device: format-swap
          id: mount-swap

        - type: partition
          number: 4
          device: disk-1
          wipe: superblock
          id: partition-extended
          flag: extended
          size: -1

        - type: partition
          device: disk-1
          size: 5G
          wipe: superblock
          id: partition-tmp
          flag: logical
        - type: format
          fstype: ext4
          volume: partition-tmp
          id: format-tmp
        - type: mount
          path: /tmp
          device: format-tmp
          id: mount-tmp

        - type: partition
          device: disk-1
          size: 16G
          wipe: superblock
          id: partition-var
          flag: logical
        - type: format
          fstype: ext4
          volume: partition-var
          id: format-var
        - type: mount
          path: /var
          device: format-var
          id: mount-var

        - type: partition
          device: disk-1
          # fill rest of disk
          size: -1
          wipe: superblock
          id: partition-home
          flag: logical
        - type: format
          fstype: ext4
          volume: partition-home
          id: format-home
        - type: mount
          path: /home
          device: format-home
          id: mount-home

Revision history for this message
Olivier Gayot (ogayot) wrote :
Olivier Gayot (ogayot)
Changed in subiquity:
status: In Progress → Fix Committed
Revision history for this message
Olivier Gayot (ogayot) wrote :

PR was merged so marking Fix Committed.

The support for this type of use case requires storage-version 2 to work properly. Sadly offsets need to be hard-coded to work around a crash until https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1991413 is fixed.

The 'wipe: superblock' directive must not be used on the extended partition or it would damage the extended partition table. See https://code.launchpad.net/~dbungert/curtin/+git/curtin/+merge/430914

Olivier Gayot (ogayot)
Changed in subiquity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.