Score:0

Is there an easy way to expand a Linux VMs disk?

cn flag

Im currently planning a cloud solution. The cloud is supposed to run on Linux VMs via vSphere. Right now, every time I want to increase the virtual disk space of an already set up Linux VM, it’s a hassle because I‘m using the gparted iso, which means I have to shut down each VM to expand the disk and then do some extra work once I’ve increased the disk to get the file system to recognize it.

Is there an easier way to do this?

Cheers

Score:1
in flag

Using LVM makes it really easy to resize the disks on the fly. But most important is to place the partition that is going to be resized at the end of the disk during installation.

For example, traditionally swap partitions are placed are the end of the disk. For VMs it's better to place them at the start and the root partition at the end, so you only need to do the resize and don't have to move the swap partition first.

Score:0
cn flag

Attach an additional LUN for data. Do not partition it. Create a data VG and use the entire disk as PV. For example, vgcreate data /dev/disk/by-id/wwn-0x600224808c29a2f7c33002b425d6da86

Skipping the partition is not a popular thing to do, some people and tools assume partitions. But Linux LVM does not need them.

With guest drivers, expanding the LUN will appear immediately to the kernel. pvresize will give the new space to LVM. lvresize --resizefs will extend the LV online, and also resize some common file systems.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.