Shrink a mounted LVM partition

Posted by javanix on Server Fault See other posts from Server Fault or by javanix
Published on 2013-10-22T14:44:49Z Indexed on 2013/10/22 15:56 UTC
Read the original article Hit count: 295

Filed under:
|
|
|
|

I fear I already know the answer to this question, but here goes.

I need to carve out a new partition on a running system. /var/ is mounted from an LVM volume (hdd1_vg-var) and has only 3% used disk space.

/ is mounted separately (hdd1_vg-root) and has about 80% used disk space.

Filesystem            Size  Used Avail Use% Mounted on
/dev/**/hdd1_vg-root
                      2.0G  1.4G  481M  75% /
/dev/**/hdd1_vg-var
                       33G  699M   31G   3% /var

Unfortunately I don't have any free extents to grow this partition organically - vgdisplay shows:

  Total PE              10000
  Alloc PE / Size       10000 / 39.06 GB
  Free  PE / Size       0 / 0

So seeing that I have all this free disk space on /var/, can I shrink /var/ without un-mounting it or is this just a pipe dream?

I am really hoping to be able to do this work on a running system - un-mounting would of course not be difficult but it would interfere with system functionality.

© Server Fault or respective owner

Related posts about centos

Related posts about redhat