[CentOS] Extending a CentOS disk without reboot

Tue Dec 22 03:17:29 UTC 2015
Keith Keller <kkeller at wombat.san-francisco.ca.us>

On 2015-12-21, Sander Kuusemets <sander.kuusemets at ut.ee> wrote:
> And while dmesg reported that it recognized the partition change, LVM 
> did still not see it. So eventually, I was still forced to reboot, after 
> which everything (pvresize, lvresize, resize2fs) worked fine. Environment:
>   * A VMWare virtual machine
>   * CentOS 6.7 (Final)
> Is there any other way I'm missing? Is this caused by the fact that I 
> was trying to resize a partition that is under the root file system? If 
> so, then is it really impossible to do it live?

As far as I know (and perhaps my knowledge is dated) it is not possible
to resize a partition on the boot device without a reboot.  I'm not sure
exactly what you mean by "partition under the root filesystem", but I'm
guessing you mean that you may have been trying to resize /.  If that's
the case, then you may be able to do this only if /boot is on a
different device.

If you were resizing / because it filled, what exactly filled up?  If
it was someplace like /tmp or /var, you may want to consider migrating
those to separate filesystems, probably under LVM, so that you have a
better chance of this succeeding.  If you can have your VMWare admin
attach a second device where you can put these filesysems even better,
that's sure to work without requiring a reboot.


kkeller at wombat.san-francisco.ca.us