1

In most of my Ubuntu 14 and 16 Servers VM's I have partitions set up like this:

lvm> lvscan
  ACTIVE            '/dev/server01-vg/root' [29.76 GiB] inherit
  ACTIVE            '/dev/server01-vg/swap_1' [2.00 GiB] inherit

When I give the VM more diskspace through the hypervisor, I use this method to make it available to the VM: Shut the system down, reboot with partedmagic/gparted and resize the partitions to the maximum available diskspace. Then I reboot again and issue a lvextend followed by a resize2fs command to add the available diskspace to my root partition.

This is pretty cumbersome, if I do this on a Windows Server system, I can just click "Expand" on the partition in Disk Management and it's done and available without rebooting.

Is there something smarter for this? Like a bash script or tool which does all that?

(I don't want to add extra partitions, only grow my root partition and make it all available to the filesystem. I am using Ubuntu Server, not Desktop, so I can't use graphical tools).

1 Answers1

0

Have you tried using gparted to change the partition size from inside the VM? You should be able to expand your root partition (mounted at '/') while running. See here for more info on expanding a partition while running.

brndn2k
  • 164