01.linux LVM logical volume technology
02.Common commands for linux LVM logical volumes
03.linux practice of creating PV/VG/LV a>
04.Linux LVM usage and management practice
05.linux deletion LV/VG/PV practice
01.linux LVM logical volume technology
Physical Volume (PV): Physical volumes are actual disks or partitions that are used to create logical volume groups.
Volume Group (VG): A volume group is a logical collection of one or more physical volumes. They provide a pool from which logical volumes can be created.
Logical Volume (LV): A logical volume is a logical storage unit divided from a volume group. They are similar to traditional disk partitions, but more flexible.
File system: A file system can be created on a logical volume to store data.
Expansion: You can dynamically expand the size of a logical volume without repartitioning or reformatting.
Snapshot: LVM can create disk snapshots for backup or testing purposes.
Move: Logical volumes can be moved freely within the volume group.
Fault tolerance: Data redundancy and fault tolerance can be provided by creating volume groups and logical volumes on multiple physical volumes.
Management tools: Linux provides a series of command line tools, such as pvcreate, vgcreate, lvcreate, etc., for creating and managing LVM.
LVM usage steps:
First initialize the disk into a physical volume PV
and then turn one or more PVs into a volume Group VG
and then create a LV from VG
**What you see when LV is expanded during use is actually increasing or decreasing the PEs that make up the LV. Quantity, the original data will not be lost in the process
The so-called PE is physical expansion
During the process of formatting the physical volume, LVM formats the underlying layer into PV , such as a 1000M hard disk, when formatting it as PV, it is actually physically divided into 250 PEs (see the picture). The default size of each PE is 4M.
02.Common commands for Linux LVM logical volumes
- pvcreate - Create a physical volume
- pvmove - physical volume removal
- vgcreate - Create a volume group
- vgscan - detect all disks in the system
- vgck - vgck[volume group name] is used to check the consistency of the volume group familiar area information in the vehicle volume group.
- vgdisplay <vg_name> - used to display the attribute information of the family members
- vgrename -vgrename original volume group name new volume group name
- vgchange - cgchange -a y|n [volume group name] //Change the corresponding attributes of the volume group. Whether it can be allocated -l maximum number of logical volumes //The volume group can accommodate the maximum number of logical volumes
- vgexport - Input for volume groups
- vgimport - Output for volume groups
- pvs - displays brief information about the PV
- vgcfgbackup - vgcfgbackup [volume group name] //Back up the VGDA information in the volume group to the "/etc/lvmconf" directory
- vgcfgrestore - vgcfgrestore -n Volume group name Physical volume full path name //Specify the information of the physical volume from the backup file
- vgcreate - Creation of volume group
- vgextend - Extension of a volume group
- vgreduce - Shrinking of volume groups
- vgmerge - Merge of volume groups
- vgsplilt - Splitting of a volume group
- vgs - displays brief information about VG
- lvcreate - Create a logical volume
- lvremore - Deletion of logical volumes
- lvexted - Expansion of a volume group
- lvreduce – reduction of logical volumes
- lvmdiskscan - detects all SCSI, IDE and other storage devices
- lvscan - Check the status of logical volumes
- lvdisplay - displays LV attribute information
- lvchange - Modify LV attribute information, -ay: mark LV as available, -an: mark LV as unavailable
- lvs - displays LV brief information
- mkfs - Format logical volume