In this post will show you how to create logical volume using maximum available free space in volume group. As a scenario, I have faced a situation at one of our customer site to create a new logical volume by allocating maximum available free space of 5TB in the volume group. You can use “lvcreate” command in Redhat Linux or CentOS to create a new logical volume with “100%Free” option to allocate the rest of free space available in the volume group.
Lvcreate Command Syntax:
Command to allocate maximum available free space to new logical volume
lvcreate -l 100%FREE -n <lv name> <vg name>
MKFS Command Syntax:
Command to create file system on logical volume
mkfs.ext3 /dev/<vg name>/<lv name>
Mount Command Syntax:
Command to mount logical volume
mount /dev/<vg name>/<lv name> /<lv name>
Creating new Logical Volume Using Maximum Available Free Space in Volume Group
As a first step, login to Linux machine as a root user and continue with the below screenshots to perform the same successfully.
In example I have used,
<lv name> – app
<vg name> – vg_disk1
Now you have successfully created a new logical volume as “app” by allocating maximum available free space of 5TB in the volume group. After mounting the logical volume as /app make sure that you put an entry in /etc/fstab for an auto-mount when system reboot.
If you find this post is useful/helpful, please follow, like and share. Thank you for visiting my blog!!!