Warning: The following does not work if you have ssh access to your server only! You need some kind of an Out of Band console session into your server like a cpanel console, vCenter, iLO, IDRAC, ...
Warning in plain English: You need to be able to see grub when you boot into Ubuntu.
The steps:
- Take a full snapshot / system backup / ... of your instance that can be restored through a boot process like PXE, an off-line bootable USB disk, ...
- No really: 95% of the time everything goes well, but have a look first on how to back up first before you have to trek up a mountain to service the Ubuntu server that is controlling that telescope!
- Download the gparted live iso
copy the downloaded file in /opt/LiveISOs
sudo mkdir /opt/LiveISOs
sudo cp ~/Downloads/gparted-live-1.0.0-3-amd64.iso /opt/LiveISOs
edit /etc/grub.d/40_custom to include the following at the end:
menuentry "GParted Live ISO" {
set ISOFile="/opt/Live-ISOs/gparted-live-1.0.0-3-amd64.iso"
loopback loop ($root)$ISOFile
linuxefi (loop)/live/vmlinuz boot=live components config findiso=$ISOFile ip=frommedia toram=filesystem.squashfs union=overlay username=user
initrdefi (loop)/live/initrd.img
}
- set grub's timeout parameter to anything but 0
update grub's config:
sudo update-grub2
Reboot to grub
Take menu option GParted Live ISO
VoilĂ : a virtual USB key has been inserted in your VM / headless server / ... virtually and you can now shrink / expand partitions off-line using gparted (or using lvm utilities from the command line!)
Note: If using VMWare, you can also attach the ISO to the VM and boot the ISO through vCenter.