[Bug 1835124] [NEW] growpart mishandles image filenames that end in a number
Launchpad Bug Tracker
1835124 at bugs.launchpad.net
Tue Jul 16 18:25:01 UTC 2019
You have been subscribed to a public bug by Rafael David Tinoco (rafaeldtinoco):
When growpart attempts to determine the partition to resize, it uses
this logic:
$ sed -n '266,275p' $(which growpart)
dpart="${DISK}${PART}" # disk and partition number
if [ -b "${DISK}p${PART}" -a "${DISK%[0-9]}" != "${DISK}" ]; then
# for block devices that end in a number (/dev/nbd0)
# the partition is "<name>p<partition_number>" (/dev/nbd0p1)
dpart="${DISK}p${PART}"
elif [ "${DISK#/dev/loop[0-9]}" != "${DISK}" ]; then
# for /dev/loop devices, sfdisk output will be <name>p<number>
# format also, even though there is not a device there.
dpart="${DISK}p${PART}"
fi
If the disk is an image, and the image filename ends with a number, the
partition will be "${DISK}p${PART}"; however, "${DISK}p${PART}" will not
be a block device. Thus, the partition is improperly identified as just
"${DISK}${PART}".
This gives us a failure like:
+ growpart -v -v -v disk-uefi.ext4 1
update-partition set to true
resizing 1 on disk-uefi.ext4 using resize_sfdisk_gpt
running[sfd_list][erronly] sfdisk --list --unit=S disk-uefi.ext4
6291456 sectors of 512. total size=3221225472 bytes
running[sfd_dump][erronly] sfdisk --unit=S --dump disk-uefi.ext4
## sfdisk --unit=S --dump disk-uefi.ext4
label: gpt
label-id: A9F73A73-50FD-4335-9082-1249985F154D
device: disk-uefi.ext4
unit: sectors
first-lba: 34
last-lba: 6291422
disk-uefi.ext4p1 : start= 227328, size= 4384735, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=C1191CD2-0753-4A53-8CD4-E6079735CA42
disk-uefi.ext4p14 : start= 2048, size= 8192, type=21686148-6449-6E6F-744E-656564454649, uuid=3A2AD377-EB6D-4689-9126-35148C003A95
disk-uefi.ext4p15 : start= 10240, size= 217088, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=98C675C8-4FF6-425C-B783-E77FDE70C967
FAILED: failed to get start and end for disk-uefi.ext41 in disk-uefi.ext4
** Affects: cloud-utils
Importance: High
Status: Fix Committed
** Affects: cloud-utils (Ubuntu)
Importance: Low
Assignee: Scott Moser (smoser)
Status: Fix Released
** Affects: cloud-utils (Ubuntu Disco)
Importance: Low
Assignee: Rafael David Tinoco (rafaeldtinoco)
Status: In Progress
** Tags: server-next
--
growpart mishandles image filenames that end in a number
https://bugs.launchpad.net/bugs/1835124
You received this bug notification because you are a member of Ubuntu Sponsors Team, which is subscribed to the bug report.
More information about the Ubuntu-sponsors
mailing list