In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Basic Operation of LVM logical Volume Management
foreword: the last article said that the partition, formatting and mounting of the hard disk can be used normally, but once the system partition is insufficient, it is necessary to back up, delete the relevant data or replan the partition to meet the needs of the system. This requires the use of LVM dynamic partitioning, which can adjust the disk capacity and improve the disk flexibility without changing the existing data.
1. Basic terms of LVM:
PV (physical volume): a physical volume is the basic storage device of a LVM, which usually corresponds to a normal partition or an entire hard disk. When you create a physical volume, a retention plate is created in the head of the partition or hard disk to record the properties of the LVM.
VG (volume group): consists of one or more physical volumes as a whole. Many physical volumes can be divided into different volume groups, and the name of the volume group is defined by the user.
LV (logical volumes): logical volumes are built on top of volume groups and are not directly related to physical volumes. For logical volumes, each volume group is a whole.
2. The process of establishing LVM partition management mechanism:
first creates the ordinary partition or the whole hard disk as a physical volume, and then forms a logical whole of the storage space of the physically scattered physical volumes, that is, the volume group; finally, based on the volume group as a whole, it is divided into different data storage space to form a logical volume, and the logical volume is the storage unit that the end user can format and mount.
3. Management commands of LVM
4. PV physical volume management command
Pvscan: used to scan all physical volumes in the system and output relevant information.
Pvcreate: converts a partition or an entire hard disk into a physical volume, mainly adding LVM attribute information and dividing PE storage units.
Pvdisplay: displays the details of the physical volume.
5. VG volume group management
Vgscan: scan information about LVM volume groups that have been established in the system.
Vgcreate: create one or more physical volumes as a volume group, the first command parameter is used to set the name of the new volume group, and then the physical volumes that need to be added to the volume group are specified as parameters.
Vgremove: used to delete the specified volume group and specify the volume group name as a parameter. When deleting, make sure that there are no logical volumes in use in the volume group.
6. LV logical volume management
Lvscan: used to scan established logical volumes and related information in the system.
Lvcreate: splits the space from the specified volume group to create a new logical volume. You need to specify the logical volume size, name, and volume group name as parameters.
Lvdisplay: displays the details of the logical volume.
Lvremove: used to delete the specified logical volume, directly using the device file of the logical volume as a parameter.
Expand the capacity of the disk
When selects automatic partitioning during the installation of the centos system, it defaults to the LVM partitioning scheme, eliminating the need for manual configuration. If you have special needs, you can also use the disk customization tool provided by the installation wizard to adjust the LVM partition. It should be noted that the "/ boot" partition cannot be created based on LVM and must be independent.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.