0% found this document useful (0 votes)
143 views2 pages

To Extend Disk Size On Centos - Zimbra - Ampliar Disco

To extend the disk size on CentOS using Zimbra, first check available free space in the volume group using vgdisplay. If there is enough free space, use lvextend to extend the logical volume and resize2fs to increase the file system size. If no free space exists, add a new disk, create a physical volume with pvcreate, extend the volume group with vgextend, then use lvextend and resize2fs.

Uploaded by

Esteban Gracia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views2 pages

To Extend Disk Size On Centos - Zimbra - Ampliar Disco

To extend the disk size on CentOS using Zimbra, first check available free space in the volume group using vgdisplay. If there is enough free space, use lvextend to extend the logical volume and resize2fs to increase the file system size. If no free space exists, add a new disk, create a physical volume with pvcreate, extend the volume group with vgextend, then use lvextend and resize2fs.

Uploaded by

Esteban Gracia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

TO EXTEND DISK SIZE ON CENTOS – ZIMBRA.

AMPLIAR DISCO

The first thing is to check if you have free extents in your volume group, to do that,
you will use:

vgdisplay
which will return details on the VG, the important line you must check is the one
that states Free PE / Size. There you will see the size available to create or extend
logical volumes. For instance in my case I have a server that says:
Free PE / Size 3834 / 14.98 GiB
Given that you have the required free space you should use:

lvextend /dev/mapper/centos-root -L +2G


In the latter case I am extending the logical volume adding 2GB. Note the +, if you
give only the size, it will go to the specified size, I usually use this syntax because it
is more transparent with the space you have available in the volume group.
After you successfully extended the volume (check with lvscan), you have to extend
the file system, you can use:
resize2fs /dev/mapper/centos-root
As mentioned by @tinmarino and @y-melo in the comments. The command above will
only work for ext2, ext3 and ext4. For xfs you should use xfs_growfs /dev/mapper/centos-root
Run df again to check that the available space has changed.

What if there's no space in the VG?


You have to first extend the volume group to be able to extend the logical volumes.
For this matter you have to add a new disk. I am assuming that the CentOS box is a
virtual machine because of the size of the disk, but of course this can be done on a physical
server too, it is just that you have to physically add a disk.
Once you have the disk on the server, you have to create an LVM physical volume
(PV), this can be created on a partition or even on the disk, I don't know the pros of
doing it on the disk, but in my experience I have found it confusing as you won't be
able to see a partition table, so I would recommend creating a partition first.

To create the PV over disk `/dev/vdb' partition 1 you do:

pvcreate /dev/vdb1
Once you have the PV, extend the VG (I don't know the name, I bet it is centos, check
on your vgdisplay):
vgextend centos /dev/vdb1

TL;DR
For VG: vg0, LV:lv0 and new disk /dev/sdb. Extending 5GB

1. Check available space on the VG: vgdisplay. If enough go to 4


2. If you don't have space add a disk and create a PV: pvcreate /dev/sdb1
3. Extend the VG: vgextend vg0 /dev/sdb1
4. Extend the LV: lvextend /dev/vg0/lv0 -L +5G
5. Check: lvscan
6. Resize the file system: resize2fs /dev/vg0/lv0 (or xfs_growfs /dev/vg0/lv0)
7. Check: df -h | grep lv0

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy