Live GPT partition expansion

Hello,

Has anybody worked on expanding GPT partitions live, without unmounting the associated xfs or ext4 filesystem? (We don’t use LVM, by the way.)

I have a working playbook that does that during VM deployments using the parted module; but because that playbook runs for new servers, I can unmount the FS no problem (parted requires FS to be unmounted) and proceed with the partition/FS expansion.
But for this project, I need to do that for existing servers which can’t afford unmounting their FS…

Shall I have to resource to calling a shell script?
(We’ve been successfully using “fdisk” to do that already, from the command line.)

Any tip/input would be truly appreciated…

Regards,

Alex

Hi Alex, sounds similar to something we have done for a client, I can’t share the role but this link is pretty much what you need to do. I did find some older systems did not always pick up the new partition sizes when partprobe was run and they have reboot task to remedy this but it would be done under a change window.

https://superuser.com/questions/660309/live-resize-of-a-gpt-partition-on-linux

Cheers.