How to extend the logical volume of LVM?

How to extend the logical volume of LVM?

You can extend the logical volume and let the LVM tool automatically resize the file system by lvresize ( lvresize manual ): Note that this method also works for shrink the LV and file system size (bug with caution since it is a more danger operation than extending the size).

How to extend a mounted ext4 file system on LVM in Linux?

The resize2fs (resize2fs manual) can resize an ext4 file system on-line to use all available disk capacity. We can resize the /home mounted by: resize2fs /dev/vg/lv_home It will prints output like follows if it executes successfully

How to extend the LVM in Red Hat?

Figure 8: Use the lvextend command to extend the LV. [root@redhat-sysadmin ~]# lvextend -l +100%FREE /dev/centos/root. You need to confirm the file system type you’re using, Red Hat uses the XFS file system, but you can check the file system with lsblk -f or df -Th.

How to check logical volume LV _ home successfully resized?

In this manual way, we do it step by step. Now, let’s extend the logical volume lv_home with the capacity from the new hard drive by lvextend ( lvextend manual ): If it prints “Logical volume lv_home successfully resized”, it should be good now. You can use lvdisplay to check the capacity of the logical volume.

The idea is to extend the size of lv_root so that we have more space to use. If you want to take a closer look at the partitions then you need to use the df command: Here you can see that the lv_root logical volume is 28G and has 12G available.

How to resize LVM partition inside an extended partition?

Add the partition you just created as a physical volume. Add the new physical volume to the volume group. Assign space from the volume group to the logical volume. Resize the filesystem. But in this scenario, you have the root filesystem (as an LVM partition) mounted under an extended partition, not within a primary partition.

How can I increase the size of my logical volume?

In short, here are the steps to extend the size of your logical volume: Create new partition on harddisk. Add the partition you just created as a physical volume. Add the new physical volume to the volume group. Assign space from the volume group to the logical volume.

Is the LV on the right side the logical volume?

The LV on the right side is our logical volume . This is a “piece” of the volume group that we can use as a partition for our operating system. Now you know about the terminology, let’s look at an actual example where we expand the size of our logical volume. In short, here are the steps to extend the size of your logical volume: