After hardware RAID array expansion fdisk wont allow me to use additional available sectors
The problem was the backup partition table location. Normaly you expect primary partition table at the start and backup partition table at the end. The disk resize made more sectors available but never moved the backup table. fdisk did not like this and I believe that was the MyLBA mismatch with real position at backup header.
error message. Not exactly clear.
I switched from fdisk
to gdisk
and the output was a little different. In gdisk you have...
r recovery and transformation options (experts only)
On going into that and running v
erify gave the more helpful error message...
Recovery/transformation command (? for help): v
Problem: The secondary header's self-pointer indicates that it doesn't reside
at the end of the disk. If you've added a disk to a RAID array, use the 'e'
option on the experts' menu to adjust the secondary header's and partition
table's locations.
Identified 1 problems!
Under gdisk
expert mode there is the following option...
e relocate backup data structures to the end of the disk
... that ran successfully, and the verify output was now...
Expert command (? for help): v
No problems found. 15625881566 free sectors (7.3 TiB) available in 2
segments, the largest of which is 15625879552 (7.3 TiB) in size.
Printing the partition table now showed the last usable sector as 56Billion rather than 39Billion and I was able to create the new partition and add it into LVM which if anyone is interested the steps for that were...
partprobe <-- add the /dev/sdb2 device if you don't want to reboot
pvcreate /dev/sdb2
vgextend bak /dev/sdb2
lvextend /dev/mapper/bak-bak -l 100%PVS -r
The key to this snafu is this:
Last LBA: 39064698846
Your GPT Label does not reflect medium size, which have changed. fdisk
does search for free space in a manner which ain't perfect, but at least logical - it looks for first available sector in the largest free space available between GPT Label's first and last LBAs.
One way around it may be using sfdisk
to dump the label, edit it appropriately to your medium size and write it back, or better use parted
that should take care of that issue IMO.