# GPT online disk enlarge

**URL:** <https://forums.suse.com/t/gpt-online-disk-enlarge/31959>\
**Category:** SLES Configure-Administer\
**Created:** [January 29, 2018, 3:52pm UTC](https://forums.suse.com/t/gpt-online-disk-enlarge/31959 "2018-01-29T15:52:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jellededoyard](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@jellededoyard](https://forums.suse.com/u/jellededoyard)\
**Post date:** [January 29, 2018, 3:52pm UTC](https://forums.suse.com/t/gpt-online-disk-enlarge/31959/1 "2018-01-29T15:52:38Z")

</div>

I am going from MBR disks to GPT disks and I am having problems online enlarging the GPT disk. I do not use LVM. I had a way of doing that online with MBR but with GPT he complains about the backup GPT table not being at the end of the disk. Can someone give me a clue on how to properly online enlarge a GPT disk/partition? Partition on it is EXT4 at the moment. I can get it to work when parted fixes the problem but I want to script it and that seems not possible at this moment.

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [January 29, 2018, 4:26pm UTC](https://forums.suse.com/t/gpt-online-disk-enlarge/31959/2 "2018-01-29T16:26:49Z")

</div>

Hi and welcome to the Forum 🙂  
You would need to look at sgdisk, partprobe and resize2fs…

For sgdisk the -e option would move the second header to the end of the disk, then recreate your partition and resize as required.

Perhaps some details of the disk/partitions in question?

This is a test system to try on, not a production one?

---

<div class="post-metadata">

**Author:** ![jellededoyard](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@jellededoyard](https://forums.suse.com/u/jellededoyard)\
**Post date:** [January 29, 2018, 4:43pm UTC](https://forums.suse.com/t/gpt-online-disk-enlarge/31959/3 "2018-01-29T16:43:20Z")

</div>

The disk is a regular disk in vmware. It is on a test system because I am still searching for the right procedure. It is a datadisk mounted at a non default directory. Ext4 is the filesystem.

I actually have a procedure for MBR disks and wanted to make the same for GPT disks.

- vmware enlarge disk
- rescan disk : echo 1 \> /sys/block/sdX/device/rescan
- fdisk : delete then new partition
- reread partition table: partx - u /sdX
- enlarge filesystem : resize2fs /dev/sdX1

The first two steps are working fine. But for the third step I wanted to use gdisk. And there it failed (the partition I could make was exactly the same as before, so not bigger). Then I used parted and it told me to fix the disk because the backup GPT table was not at the end of the disk. After parted fixed it, I went back to gdisk and did the same as in fdisk for MBR.

After that I tried partprobe but that didnt work (said the system was still busy, it was mounted) but partx worked. As did resize2fs.

So I actually managed to do the online enlarge but I cannot script this way. It is kind of a big detour which I want to avoid.

I will have a look at sgdisk. Thank you.
