When you will increase the logical volume size, you will either set the size of the logical volume or extend it with the size you want. In any case, we will use the command lvextend for systems other than Red Hat.
Before using lvextend with an example, let's see our notation:
- The volume group is named logvol01 and is mounted under /dev and in volgrp01 (the mountpoint is /dev/volgrp01/logvol01)
- We will increase the logical volume to the space available in /dev/sdb1, assuming we have installed another disk on the system
- The present size of the logvol01 is 200 Gigabytes and we want to extend it to 500 Gigabytes by adding the 300 Gigabytes on /dev/sdb1
- Of course, /dev/sdb1 must have at least 300 Gigabytes of free space, and
- We have already made /dev/sdb1 a member of volgrp01.
When we have completed all above, we can use the lvextend command as follows to:
- Set size to 500 GB: lvextend -L500G /dev/volgrp01/logvol01 /dev/sdb1
- Increase size by 300 GB: lvextend -L+300G /dev/volgrp01/logvol01 /dev/sdb1
- To use all available space in /dev/sdb1: lvextend /dev/volgrp01/logvol01 /dev/sdb1 (note that there is no option set for the lvextend command)
To make the command run in verbose mode, you can use the additional -v option.
For the users running Red Hat systems, it will be better to utilize Red Hat's Disk Druid tool, which is a graphical tool to group and ungroup logical volumes and change their sizes.