Posted in RHCE
Managing LVM on Redhat-based systems
Steps :
1. Creation of Physical Volumes (container of volume groups)
2. Creation of Volume Groups (container of logical volumes)
3. Creation of Logical Volumes (“partitions”)
4. Formatting the Logical Volumes
5. (optional) Resizing Logical Volumes
1. Creation of Physical Volumes (PV)
pvcreate /dev/hda4
pvdisplay
It is good practice to always use “(pv|vg|lv)display” after creating a volume.
/dev/hda4 is an empty partition.. see fdisk manpages for help.
2. Creation of Volume Groups (VG)
vgcreate VolGroup00 /dev/hda4
vgdisplay
We are naming the volume group “VolGroup00″, call it whatever you like.
The VG will take the whole partition space here. You can specify the size by using the “-s” option.
3. Creation of Logical Volumes (LV)
lvcreate --size 500M --name LogVol00 VolGroup00
lvdisplay
A 500M Logical Volume has been creating inside “VolGroup00″.
4. Formatting the newly created Logical Volume
mkfs.ext3 /dev/VolGroup00/LogVol00
mount /dev/VolGroup00/LogVol00 /somedir
5. (optional) Resizing a Logical Volume
umount /somedir
lvextend -v -L +100M /dev/VolGroup00/LogVol00
e2fsck -f /dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00
mount /dev/VolGroup00/LogVol00 /somedir
We made the Logical Volume 100M bigger.
Then, you need to resize the ext3 partition inside the Logical Volume.
Comments
Sébastien Wains
Hi Brad,
Glad you find my RHCE notes useful, while they were not intended to be comprehensive or anything.
A good preparation and experience in Linux is the key to success !
Good luck, keep me updated..
Seb
Kiran
Your RHCE-Prep posts assisted me greatly in upgrading from RHEL3 to RHEL5. Keep up the great work
Leave Comment
Please consider visiting the partners below if you enjoyed this article :If this post saved you time and money, please consider checking my Amazon wishlist.







Brad Smith
Thanks for all the tutorilas. I am taking my RHCE Jun 22. I have found them very helpful. I hope you plan to do more. If you have any words of encouragement please drop me a line.
Brad