growpart uses wrong device for partition for dm block devices
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-initramfs-tools |
New
|
Undecided
|
Unassigned |
Bug Description
When trying to grow a partition on a DM block device (for example a multipath device), growpart creates the wrong name for the partition to grow:
real case output:
growpart -N -v /dev/mapper/root01 2
/dev/mapper/root01 resolved to /dev/dm-2
update-partition set to true
resizing 2 on /dev/dm-2 using resize_sfdisk_dos
209717760 sectors of 512. total size=107375493120 bytes
## sfdisk --unit=S --dump /dev/dm-2
label: dos
label-id: 0x316e4f76
device: /dev/dm-2
unit: sectors
/dev/mapper/
/dev/mapper/
FAILED: failed to get start and end for /dev/dm-22 in /dev/dm-2
growpart wants to use partition /dev/dm-22, which does not exist in this case. It could very well also be a different multipath device, possibly leading to data loss.
The correct partition name is /dev/mapper/