How to Resize Volumes After They are Created
A filesystem on a logical quantity can also be prolonged the use of the LVM software each time the logical quantity shorts for house. The prolonged logical quantity has extra space and capability than the former logical quantity. In this educational, we can speak about how the LVM command-line interface and the graphical person interface can be utilized to increase the logical quantity.
Pre-requisites
In order to move in conjunction with this text, you will have to have
- A bodily quantity out of your garage force
- A bodily quantity underneath quantity crew
- Logical quantity over quantity crew
- Filesystem on logical quantity
Use the lsblk command to test bodily volumes.
Notice the 3 to be had bodily volumes /dev/sda, /dev/sdb and /dev/sdc within the above screenshots. Now, record the entire quantity teams at the gadget the use of any of those vgdisplay, vgscan and vgs instructions.
OR
OR
There is just one quantity crew vg01 constructed from just one bodily quantity. Now, record the entire to be had logical volumes at the quantity crew vg01 the use of lvs, lvscan or lvdisplay command.
OR
OR
The output above shows two logical volumes lv01 and lv02 at the quantity crew vg01. If you don’t have any of the above necessities, test the former articles on LVM.
Extend Logical Volume
Before logical quantity extension, ensure there’s enough room within the quantity crew containing the logical quantity. Use the vgs, vgdisplay or vgscan command to make sure the to be had house within the quantity teams.
OR
The present measurement of the amount crew vg01 is ready 30 GB and there’s a unfastened house of 15 GB to be had within the quantity crew. If there isn’t enough room to be had within the quantity crew, then the amount crew will likely be expanded first to create unfastened house. Alternatively, if there are extra logical volumes within the quantity crew, shrink those quantity teams to create unfastened house.
After checking the amount crew without cost house, now test the present measurement of the logical quantity and estimate its prolonged measurement. The lvdisplay command can be utilized to get the guidelines of the present logical quantity.
So, there are two logical volumes lv01 and lv02 with the scale of 10 GB and 5 GB respectively. For this demo, allow us to building up the scale of the logical quantity lv01 from 10 GB to fifteen GB. In order to extend the logical quantity measurement, the lvextend command will likely be used in conjunction with the -L flag.
The lvextend command has greater the scale of quantity crew lv01 from 10 GB to fifteen GB. In order to verify the scale of the logical quantity the use of the command line interface, use any some of the lvdisplay, lvscan and lvs instructions.
OR
OR
Use the vgs or vgdisplay instructions to show the occupied and unfastened house of the amount crew vg01.
OR
As proven above, the amount crew vg01 has a unfastened house measurement of 15GB and now there’s most effective 10 GB of unfastened house which depicts a success logical quantity extension.
After extending the scale of the logical quantity, mount the logical quantity at the gadget to make sure document gadget extension.
After mounting the logical quantity, record the entire fastened filesystems at the gadget.
The filesystem continues to be 10 GB in measurement and it additionally must be prolonged one at a time. The resize2fs command can be utilized to increase an ext4 filesystem.
Now, use the df command to test the filesystem fastened at the gadget once more to make sure extension.
The filesystem fastened at the gadget is 15 GB in measurement and has been prolonged effectively.
Extend Logical Volume by the use of GUI Tool
An more uncomplicated approach to prolong logical quantity measurement is the use of a graphical person interface software this is kvpm. You can in finding directions about putting in the software within the earlier articles. Open the kvpm through working the kvpm command within the terminal.
It will open a window containing details about the entire block gadgets hooked up to the gadget. For this phase, we can prolong the logical quantity lv02 from 5 GB to ten GB.
In order to increase the logical quantity measurement, move to the Group:vg01 tab and choose the logical quantity lv02. Then prolong the record of the choices through clicking at the arrow signal and click on at the Extend choice.
For the brand new measurement of the logical quantity choose the General tab, input the brand new measurement of the logical quantity and click on at the OK button to extend the scale.
It will increase the logical quantity measurement that may be seen from the kvpm software.
In order to increase the filesystem, choose the Group: vg01 tab, choose the logical quantity lv02 and click on at the Extend fs button.
A window activates for affirmation prior to extending the filesystem.
Alternatively, the logical quantity measurement and filesystem may also be showed the use of the command line interface. The lvdisplay and df instructions can be utilized to show the entire main points of the logical volumes.
Mount the logical quantity at the gadget and test the filesystem measurement.
Conclusion
Extending the logical quantity measurement for a server is a the most important activity as a document gadget fastened at the server would possibly run out of house. LVM supplies facility to increase the logical quantity measurement with out dealing with any downtime. This weblog explains the entire steps to increase an present logical quantity and the filesystem the use of the command line interface and graphical person interface software.