Common commands for Lvm logical volume management

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.
The default size of each pe is 4M. Insert picture description here
Insert image description here

02.Common commands for Linux LVM logical volumes

  1. pvcreate - Create a physical volume
  2. pvmove - physical volume removal
  3. vgcreate - Create a volume group
  4. vgscan - detect all disks in the system
  5. vgck - vgck[volume group name] is used to check the consistency of the volume group familiar area information in the vehicle volume group.
  6. vgdisplay <vg_name> - used to display the attribute information of the family members
  7. vgrename -vgrename original volume group name new volume group name
  8. 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
  9. vgexport - Input for volume groups
  10. vgimport - Output for volume groups
  11. pvs - displays brief information about the PV
  12. vgcfgbackup - vgcfgbackup [volume group name] //Back up the VGDA information in the volume group to the "/etc/lvmconf" directory
  13. vgcfgrestore - vgcfgrestore -n Volume group name Physical volume full path name //Specify the information of the physical volume from the backup file
  14. vgcreate - Creation of volume group
  15. vgextend - Extension of a volume group
  16. vgreduce - Shrinking of volume groups
  17. vgmerge - Merge of volume groups
  18. vgsplilt - Splitting of a volume group
  19. vgs - displays brief information about VG
  20. lvcreate - Create a logical volume
  21. lvremore - Deletion of logical volumes
  22. lvexted - Expansion of a volume group
  23. lvreduce – reduction of logical volumes
  24. lvmdiskscan - detects all SCSI, IDE and other storage devices
  25. lvscan - Check the status of logical volumes
  26. lvdisplay - displays LV attribute information
  27. lvchange - Modify LV attribute information, -ay: mark LV as available, -an: mark LV as unavailable
  28. lvs - displays LV brief information
  29. mkfs - Format logical volume

Guess you like

Origin blog.csdn.net/weixin_43798406/article/details/133159288