Have such partitions/volumes/mountpoints:

=$ LC_ALL=C df -hP | column -t
Filesystem              Size  Used  Avail  Use%  Mounted  on
/dev/mapper/vg0-rootlv  19G   854M  17G    5%    /
/dev/mapper/vg0-homelv  19G   343M  18G    2%    /home
/dev/mapper/vg0-optlv   19G   192M  18G    2%    /opt
/dev/mapper/vg0-varlv   19G   357M  18G    2%    /var

Question is: how can I grow /home and /var partitions (to 100GB and 400GB respectively)?

Is it safe to do it online with database running on this server?

  • You can do this online but you need to have free space in the VG or the ability to add a physical volume and grow it. use vgdisplay to check if you have free space available. – egorgry Apr 22 '11 at 15:07
  • I have the free space. – user13185 Apr 22 '11 at 16:44

First check if you have free space in volume group:


then resize the volumes:

lvresize -L 400G /dev/mapper/vg0-varlv
lvresize -L 100G /dev/mapper/vg0-homelv

and resize the filesystems residing on them:

resize2fs /dev/mapper/vg0-varlv
resize2fs /dev/mapper/vg0-homelv

I have to note though that resizing a partition from 20GB to 400GB will make your inodes quite sparse. If it is at all possible I strongly recommend creating new volumes with new filesystems and moving data there. You can copy the files during normal operation and then just rsync the changed files to new partition during downtime.

| improve this answer | |
  • Can you elaborate on "inodes quite sparse"? What does it mean, what are the drawbacks? – user13185 Apr 22 '11 at 18:29
  • 4
    ext file systems have the available number of inodes set at file system creation time, resizing the FS will make the inodes more sparse. So, unless the FS was created with -O resize_inode you may run into a situation in which you have free space on disk but no inodes to address it. If you know that most files will be big it's not a problem, but if the files will be small you may have problems down the line. – Hubert Kario Apr 22 '11 at 19:19
  • 1
    It's nice to know that you don't need to always use your final storage size. You can also ask your system to add for example 10G to current logical volume size using something like (look at the +): lvresize -L +10G /dev/mapper/vg0-homelv – gerlos Jun 16 '15 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy