Growpart doesn't resize partition when using quotation marks in partition name

Bug #1785417 reported by Ondrej Linha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Fix Committed
Undecided
Unassigned

Bug Description

It appears when diskimage-builder inserts quotation marks to the partition name, growpart in cloud-init can't resize that partition

```
growpart /dev/vda 2
attempt to resize /dev/vda failed. sfdisk output below:
| GPT PMBR size mismatch (5004927 != 41943039) will be corrected by w(rite).
| Backup files:
| PMBR (offset 0, size 512): /tmp/growpart.U0nr5M/orig.save-vda-0x00000000.bak
| GPT Header (offset 512, size 512): /tmp/growpart.U0nr5M/orig.save-vda-0x00000200.bak
| GPT Entries (offset 1024, size 16384): /tmp/growpart.U0nr5M/orig.save-vda-0x00000400.bak
|
| Disk /dev/vda: 20 GiB, 21474836480 bytes, 41943040 sectors
| 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: 30CA77E6-2F96-476E-B4DD-43D5CC810506
|
| Old situation:
|
| Device Start End Sectors Size Type
| /dev/vda1 2048 67583 65536 32M BIOS boot
| /dev/vda2 67584 5001215 4933632 2.4G Linux filesystem
|
| >>> Script header accepted.
| >>> Script header accepted.
| >>> Script header accepted.
| >>> Script header accepted.
| >>> Script header accepted.
| >>> line 7: unsupported command
|
| New situation:
| Disklabel type: gpt
| Disk identifier: 30CA77E6-2F96-476E-B4DD-43D5CC810506
|
| Device Start End Sectors Size Type
| /dev/vda1 2048 67583 65536 32M BIOS boot
| /dev/vda2 67584 5001215 4933632 2.4G Linux filesystem
| Leaving.
|
FAILED: failed to resize
***** WARNING: Resize failed, attempting to revert ******
512+0 records in
512+0 records out
512 bytes copied, 0.00161046 s, 318 kB/s
512+0 records in
512+0 records out
512 bytes copied, 0.00136544 s, 375 kB/s
16384+0 records in
16384+0 records out
16384 bytes (16 kB, 16 KiB) copied, 0.0397953 s, 412 kB/s
***** Restore appears to have gone OK ****
```

When you edit `/block_device/level1/partitioning.py` line 139 to `args['name'] = '%s' % p.get_name()` everything works fine.

Revision history for this message
Ian Wienand (iwienand) wrote :

This is only happening with gpt right? This was fixed in https://review.openstack.org/#/c/578265/ which will be in the next release.

We also got this fixed upstream (https://github.com/karelzak/util-linux/issues/656)

Changed in diskimage-builder:
status: New → Fix Committed
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.