canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.68k stars 637 forks source link

Disk resizing not working for core20/22 images #3229

Open ricab opened 11 months ago

ricab commented 11 months ago

Describe the bug After attempting to grow the disk of a core20- or core22-based instance, no partition is grown to reflect the new size.

$ multipass exec -n a -- sudo fdisk -l /dev/sda
GPT PMBR size mismatch (10485759 != 14680063) will be corrected by write.
The backup GPT table is not on the end of the device.
Disk /dev/sda: 7 GiB, 7516192768 bytes, 14680064 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: A63BB26A-5487-41C0-AF40-19150D00E322

Device       Start      End Sectors  Size Type
/dev/sda1     2048     4095    2048    1M BIOS boot
/dev/sda2     4096  2461695 2457600  1.2G EFI System
/dev/sda3  2461696  3997695 1536000  750M Linux filesystem
/dev/sda4  3997696  4063231   65536   32M Linux filesystem
/dev/sda5  4063232 10485726 6422495  3.1G Linux filesystem

Note: tried with core as well, where the writable partition was properly resized, although disk reporting in info is wonky (13.7GiB).

To Reproduce How, and what happened?

  1. multipass launch -n a core22
  2. multipass stop a
  3. multipass set local.a.disk=7G
  4. multipass start a
  5. multipass info a | grep Disk
    • observe reported disk space is still around 4.8G
  6. multipass exec -n a -- sudo fdisk -l /dev/sda

Expected behavior The writable partition (/dev/sda5 above) would grow to use the available disk space.

Logs

set 15 22:24:13 ricab-laptop multipassd[173643]: Succeeded setting local.a.disk=7G

Additional info

Name: b State: Running IPv4: 10.195.134.83 Release: Ubuntu Core 16 Image hash: db3a6130f46f (Ubuntu Core 16) CPU(s): 1 Load: 0.00 0.00 0.00 Disk usage: 1.1GiB out of 13.7GiB Memory usage: 32.2MiB out of 986.4MiB Mounts: --

Name: c State: Running IPv4: 10.195.134.175 Release: Ubuntu Core 20 Image hash: 4692ea67d73e (Ubuntu Core 20) CPU(s): 1 Load: 0.02 0.02 0.00 Disk usage: 1.0GiB out of 4.8GiB Memory usage: 97.2MiB out of 971.2MiB Mounts: --


- `multipass get local.driver`: qemu
itvexesme commented 10 months ago

Faced the same issue