Volume expanding with Linux VMs

Is this something that windows just does better/ more simply?

Every time we need to expand a disk/volume in a linux vm (Ubuntu Server most of the time), it usually requires us to reboot it first, after extending the disk in vsphere. Then we can go through Parted and resize2fs.

Is there a straight forward way to do this online like you can with disk manager in windows?

Cheers!

if you use LVM yes, no reboot required.

If you do it the old fashioned way, then yeah a reboot.

1 Like

There’s no real reason for rebooting a vm, usually.
For linux-dists, one might have to perform a rescan;
echo 1 > /sys/class/block/sd[x]/device/rescan
I’ve not yet seen anything so old that a reboot is needed. If I am in the wrong, please do give some details if possible of your versions etc.
LVM does not aid in this at all as per my experience - it’s simply a logical volume, but under it it’s still drives. However, if you are running LVM, you can ofc just add a disk, and then go through the motions to add it to the volume, and then expand the underlying filesystem.

1 Like

Thanks, the rescan never seems to work on the ubuntu vms, but ill test it again and report back.

These are just standard ubuntu server, more or less default config on installation.

Don’t type these low-level commands if you don’t have to.

Best to install sg3-utils which provides rescan-scsi-bus

1 Like

Well, that’s a don’t without a reason - in short, I would think that sg3-utils performs the same thing.
Either way, I’ll continue to do this without additional tool set that results in the same thing.

Writing to /proc and /sys is dangerous. A minor typo can easily crash your system. Mature programs don’t make typos.

Sure, it can cause issues if you don’t know what you’re doing. However, flipping a scan-flag is not causing havoc.
To know that a program is mature, and correctly programmed - I’d need to validate the program and source - while typing it straight into the prompt, I have already validated what I have asked to be performed.