How to extend LVM in CentoOS7

General support questions
Post Reply
zahmad
Posts: 1
Joined: 2019/07/16 06:49:44

How to extend LVM in CentoOS7

Post by zahmad » 2019/07/16 07:04:40

Dears,

I have configured an email Server on Huawei Fusion Compute(Virtualization environment) and is now live for my organization.
I realized that the space for backup is low and need to extend the space of (/dev/mapper/centos-opt_zimbra_back up 200G 97G 104G 49% /opt/zimbra/backup).

I will add space from my SAN to that particular VM but how can i will add that space to /opt/zimbra/backup.

Please guide and help me in this regard.

Following is the result of df -h
==========================================================
[root@mail ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 48G 7.5G 41G 16% /
devtmpfs 12G 0 12G 0% /dev
tmpfs 12G 0 12G 0% /dev/shm
tmpfs 12G 666M 11G 6% /run
tmpfs 12G 0 12G 0% /sys/fs/cgroup
/dev/xvda1 1014M 200M 815M 20% /boot
/dev/mapper/centos-opt 120G 44G 77G 37% /opt
/dev/mapper/centos-opt_zimbra_back up 200G 97G 104G 49% /opt/zimbra/backup
/dev/mapper/centos-var 15G 3.2G 12G 21% /var
tmpfs 2.3G 0 2.3G 0% /run/user/0
===========================================================

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to extend LVM in CentoOS7

Post by TrevorH » 2019/07/16 12:15:35

You can either create a new partition on the same virtual disk, tag that as type LVM, save it, reboot to get it recognised then run pvcreate/vgextend to add the new free space to your current Volume Group then use lvextend -r to enlarge your LV.

Or if you prefer to add the new space to the existing partition that is your current PV then you would need to add the space to the disk, use fdisk to print the current partition table in sector mode, make a note of the exact starting sector of the current partition then delete it, add it back in starting on the same identical sector number and give it a larger ending sector number, tag it as type LVM, save it, reboot then run pvresize on the current partition to tell it that there is more space which will be automatically part of the existing VG and then you can use lvextend -r again.

The second method is marginally more dangerous than the first but you end up with only one partition in use.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply