I've extended my hardware RAID device on LSI MegaRAID controller by adding disks to the array. While making Linux notice the block device size change was not straight forward, I've found that one can rescan the device (using echo y > /sys/devices/pci0000:00/0000:00:02.2/0000:03:00.0/host0/target0:2:0/0:2:0:0/rescan
in my case, for first logical drive) to fix that.
Unfortunately, I'm stuck at this point.
XenServer 6.0 by default uses GPT not MBR partitions and as such, using fdisk
to modify partition table is impossible (the usual tool I've used to extend physical partitions). GPT labels save not only the position of partitions but also size of the disk (by saving the secondary GPT header at last 34, or so, sectors). Probably because of that, the
gdisk
and sgdisk
utilities can't resize the last partition above the old drive limit.
I've tried fdisk
(does not work with GPT), sfdisk
(does not work with GPT), parted
(not installed), cfdisk
(not installed).
What tool and commands should I use to extend GPT partitions on system without parted
?
An hour of googling was 5 minutes short to find the answer... anyway:
gdisk
andsgdisk
allow to relocate the second GPT header in "expert mode".If the basic situation was like this:
(note the
last usable sector is 1951170526
)By using the
x
command ingdisk
and thene
command, the partition table looks like this:(note the
last usable sector is 3902341086
)After that, removing and re-creating a larger partition works without a problem.
gdisk
got a look and feel offdisk
, but for GPT. Also, why not reboot to a live distro of partedmagic and just do partitioning there with the newest parted?You can also install parted with the following command: