The Linux Logical Volume Manager (LVM) is a mechanism to virtualize the disks.
It can create "virtual" disk partitions out of one or more physical hard drives, allowing you to grow, shrink, or move those partitions from drive to drive as your needs change.
It also allows you to create larger partitions than you could achieve with a single drive.
Creating a Physical Volume (PV)
Create a partition using fdisk, and change the hex code of it to 8e.
Save and exit the fdisk and update the partition table using partx -a command
Create a PV on newly created partition i.e. /dev/sdax.
Verify it by pvs or pvdisplay command
Syntax: #pvcreate partition name
#pvcreate /dev/sdax
To see the details of a particular PV, use the command
#pvdisplay partition name
Creating a Volume Group (VG)
After creating a PV, the next step is to create a Volume Group or VG
To create a VG the syntax is
#vgcreate name for the VG partition name
#vgcreate myvg /dev/sdax
Once we are ready with a Volume Group then it’s the time to create a Logical Volume LV
The syntax for creating an LV is
#lvcreate -L size of LV -n name for LV VG name
#lvcreate -L 300M -n mylv myvg (To create a LV of 200MB)
As per now we have our VG created so is our LV. In order make it accessible we need to format it with a file system like ext4 or ext3 or vfat.
The syntax for formatting an LV is exactly like formatting a normal partition, Instead of /dev/partition name we use the path of LV that will be something like /dev/vg/lv
#mkfs.ext4 m/dev/yvg/mylv
Mounting an LV is exactly same like a normal partition, again the path for mounting will be /dev/vg/lv
Create a directory over which the LV should be mounted.
#mount /dev/vgname/lvname /directory name
#mount /dev/myvg/mylv /hyd
Verify the mounting with mount command
Make it a permanent mount by making an entry in /etc/fstab
Смотрите видео How to create and extend a Logical Volume (LV)? LVM in linux(RHEL 6) part 1 онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Red hat Linux Training for beginners 06 Июль 2020. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 380 раз и оно понравилось 13 посетителям.