Subiquity suggests a resize of already mounted (log-persistence) partition

Bug #2059389 reported by Olivier Gayot
158
This bug affects 18 people
Affects Status Importance Assigned to Milestone
subiquity
Fix Released
Undecided
Olivier Gayot
ubuntu-desktop-provision
Triaged
Undecided
Unassigned

Bug Description

I created a USB install media with Ubuntu Desktop 24.04 on it.

The installer suggested an installation alongside other partitions with sdb4 as the target. Later on, after confirming the partitioning changes, the installation failed and curtin logs show:

    running e2fsck (or equivalent) with an error such as:

      Resize requested for format ext4
      Resizing /dev/sdb4 of type ext4 down to 12546211840
      Running command ['e2fsck', '-p', '-f', '/dev/sdb4'] with allowed return codes [0] (capture=False)
      /dev/sdb4 is mounted.
      e2fsck: Cannot continue, aborting.

      An error occured handling 'disk-sdb': ProcessExecutionError - Unexpected error while running command.
      Command: ['e2fsck', '-p', '-f', '/dev/sdb4']
      Exit code: 8

In my scenario sdb is the installation media and sdb4 is the log-persistence partition created by casper. As mentioned in bug 1926137 [1], there is no sensible way to make curtin unmount a filesystem that has /var/log on it. IMO Subiquity should not suggest a resize of a partition that is already in use in the live environment.

I think this is a regression that was introduced when we added the ability to create a recovery partition on the installation media.

I'm attaching the storage probe data that can be used to reproduce the issue. One can see the suggested scenario in dry-run mode by using this probe data and running the following steps:

1. make dryrun
2. navigate to the guided storage screen
3. in a separate shell run:
    $ curl --unix-socket .subiquity/socket http://a/storage/v2/guided

```
{
  "status": "DONE",
  "error_report": null,
  "configured": null,
  "targets": [
    {
      "disk_id": "disk-sda",
      "allowed": [
        "DIRECT",
        "LVM",
        "LVM_LUKS",
        "ZFS",
        "ZFS_LUKS_KEYSTORE"
      ],
      "disallowed": [],
      "$type": "GuidedStorageTargetReformat"
    },
    {
      "disk_id": "disk-sda",
      "partition_number": 7,
      "new_size": 189269016576,
      "minimum": 28505538560,
      "recommended": 189269016576,
      "maximum": 221172989952,
      "allowed": [
        "DIRECT",
        "LVM",
        "LVM_LUKS",
        "ZFS",
        "ZFS_LUKS_KEYSTORE"
      ],
      "disallowed": [],
      "$type": "GuidedStorageTargetResize"
    },
    {
      "disk_id": "disk-sdb",
      "partition_number": 4,
      "new_size": 17775460352,
      "minimum": 2619342848,
      "recommended": 17775460352,
      "maximum": 50505711616,
      "allowed": [
        "DIRECT",
        "LVM",
        "LVM_LUKS",
        "ZFS",
        "ZFS_LUKS_KEYSTORE"
      ],
      "disallowed": [],
      "$type": "GuidedStorageTargetResize"
    },
    {
      "allowed": [
        "MANUAL"
      ],
      "disallowed": [],
      "$type": "GuidedStorageTargetManual"
    }
  ]
}
```

[1] https://bugs.launchpad.net/ubuntu/+source/casper/+bug/1926137/comments/4

Revision history for this message
Olivier Gayot (ogayot) wrote :
Olivier Gayot (ogayot)
summary: - Subiquity suggests a resize of already mounted log-persistence partition
+ Subiquity suggests a resize of already mounted (log-persistence)
+ partition
Revision history for this message
Olivier Gayot (ogayot) wrote (last edit ):

In some of the private reports that I marked as duplicates, it is a partition mounted at /media/ubuntu/$UUID that is targeted for resize. I wonder if it gets automount-ed or if it gets mounted when the one clicks on the device in the GUI.

Changed in subiquity:
assignee: nobody → Olivier Gayot (ogayot)
status: New → In Progress
Revision history for this message
Olivier Gayot (ogayot) wrote :

Opened https://github.com/canonical/subiquity/pull/1957 as an attempt to fix this.

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

Did this solve the issue? The fix is has been included in ubuntu-bootstrap already.

Changed in ubuntu-desktop-provision:
status: New → Triaged
Revision history for this message
Dan Bungert (dbungert) wrote :

We believe this issue has been resolved in Subiquity 24.04.1, which can be obtained on the Ubuntu 24.04 LTS ISO or as a snap refresh.

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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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