Hi Folks,
== tl;dr:
cloud-config: resize_device: /dev/vda
=>
growpart fails with: ‘Start sector 0 out of range’.
== Long Version:
We use the RancherOS Version 1.0.
In the cloud-config we configured the following so that the first partition grows to volume size:
-------------------- >8 --------------------
rancher:
resize_device: /dev/vda
-------------------- >8 --------------------
It is an Openstack environment. The instance has one 70GB Volume:
-------------------- >8 --------------------
Disk /dev/vda: 70 GiB, 75161927680 bytes, 146800640 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: dos
Disk identifier: 0x3452b8fc
Device Boot Start End Sectors Size Id Type
/dev/vda1 * 0 176127 176128 86M 17 Hidden HPFS/NTFS
-------------------- >8 --------------------
As you can see, the first partition (vda1) was not resized (only 86MB).
When we look into the ‘cloud-init-execute’-Container logs, we can see the Problem:
-------------------- >8 --------------------
attempt to resize /dev/vda failed. sfdisk output below:
| Backup files:
| MBR (offset 0, size 512): /tmp/growpart.gUvcEQ/orig.save-vda-0x00000000.bak
|
| Disk /dev/vda: 70 GiB, 75161927680 bytes, 146800640 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: dos
| Disk identifier: 0x3452b8fc
|
| Old situation:
|
| Device Boot Start End Sectors Size Id Type
| /dev/vda1 * 0 176127 176128 86M 17 Hidden HPFS/NTFS
|
| >>> Script header accepted.
| >>> Script header accepted.
| >>> Script header accepted.
| >>> Script header accepted.
| >>> Created a new DOS disklabel with disk identifier 0x3452b8fc.
| Start sector 0 out of range.
| Failed to add partition: Numerical result out of range
| Leaving.
|
FAILED: failed to resize
***** WARNING: Resize failed, attempting to revert ******
512+0 records in
512+0 records out
***** Appears to have gone OK ****
-------------------- >8 --------------------
Is it a Bug in the “growpart” Script or a Bug in sfdisk or am I doing something completely wrong?
Thanks and kind regards,
larsux