2

I'm having trouble extending my partition on a XenServer 6.5. I originally had a 1.4TiB device (hardware RAID5) that I since upgraded to 10.9TiB. I upgraded the RAID by swapping out one disk at a time until the 4 disks were replaced.

I then used the RAID configuration to extend the RAID to the full 10.9TiB size.

=> ctrl slot=4 ld all show status
   logicaldrive 1 (10.9 TB, 5): OK

I've next told Xen dom to rescan the scsi device:

echo 1 >  /sys/block/sda/device/rescan 

Now when I start gdisk, I see the following:

Disk /dev/sda: 23441913520 sectors, 10.9 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): A28B730F-3064-494E-BD7E-DDE8CAD5A12D
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2930122766
Partitions will be aligned on 2048-sector boundaries
Total free space is 6042 sectors (3.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         8388641   4.0 GiB     0700  
   2         8390656        16777249   4.0 GiB     0700  
   3        16779264      2930122766   1.4 TiB     8E00  

So I see that gdisk is able to see the full 10.9TiB, but I can't seem to delete and recreate parititon 3 to be larger than the original 1.4TiB. Furthermore, it says last usable sector is 2930122766.

How can I get gdisk to allow me to create a partition that goes from sectors 16779264-23441913520?

Eric B.
  • 479
  • 1
  • 5
  • 14
  • Try to use parted, it can expand partition without deleting it. Do you use LVM on `/dev/sda3`? – Mikhail Khirgiy May 06 '17 at 05:10
  • @MikhailKhirgiy - Sadly, I can't seem to find an rpm package parted for XenServer 6.5 (based on CentOS 5). But I still do not understand why gdisk won't allow me to extend beyond the maximum value of the original disk. – Eric B. May 06 '17 at 12:26
  • And what about LVM? – Mikhail Khirgiy May 06 '17 at 15:58
  • @MikhailKhirgiy - Sorry... Yes it is an LVM partition. – Eric B. May 06 '17 at 16:02
  • LVM is used only for virtual machines or for Xen system partitions also? – Mikhail Khirgiy May 07 '17 at 08:20
  • @MikhailKhirgiy It's just for the VMs (as far as I know). At this point, I gave up though. I finally managed to find a version of parted that worked. It complained about bad location of a GPT table so moved it. Then I was able to resize. But I had to reboot for the system to recognize the new partition defn. But when I did, it seems to have messed with the boot loader b/c I couldn't boot from the drive anymore. In the end I gave up and reinstalled Xen on top of it again. Fixed my boot loader. – Eric B. May 10 '17 at 01:11
  • It's a strange, because root partition wasn't on LVM. I think you could resize partition without reboot via `gdisk` after stopping all virtual machines and​ LVM volume group. – Mikhail Khirgiy May 10 '17 at 05:29
  • ```o create a new empty GUID partition table (GPT) ```, I just came across this issue, but it's late so i did fdisk then back to gdisk to force a new gpt... but "o" would have worked. (for those with multiple partitions i'd use sgdisk) – mikejonesey May 10 '19 at 01:22

1 Answers1

8

Let gdisk verify the disk for problems (key v).

In my case it identified:

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.

I used x e.

Then m(ain menu) p showed the "last usable sector" as expected.

klaus thorn
  • 329
  • 3
  • 11