In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
How to create and expand the logical volume in ECS, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.
[background description]:
To achieve cross-disk use, the layer above the traditional hard disk can be used across EVS in CVM. In some scenarios, users need to create logical volumes or expand the existing logical volumes, or in some cases, the above operations fail due to misoperation.
[operation Overview]:
Create logical volume overall process: create physical volume → create volume group → create logical volume → establish file system → create mount point → mount file system → set up boot automatic mount
The whole process of expanding logical volume: expanding volume group (expanding idle volume group into volume group) → expanding logical volume → expanding file system
[procedure]: operation 1: create a logical volume
(1) View all physical volumes through the fdisk-l command
The partition of the above mounted data disk has created a file system, and the file system is also mounted. The direct execution of the physical volume creation command fails and the file system needs to be unmounted, and the file system will be deleted during the logical volume creation process.
(2) create a volume group
[note] the premise is that the partition cannot have a file system and cannot be mounted
Pvcreate / dev/vdb1 / dev/vdc1 or pvcreate / dev/vd [bmeme c] 1 (wildcards)
Since the file system has been established on the disk before, the file system needs to be cleared.
If the echo command does not exist, download the installation tool through the yum install lvm2 command
(3) View physical volumes through pvs
(4) create a volume group through the command vgcreate vg1 / dev/vdb1 / dev/vdc1
[note] one pv cannot join two vg
(5) create logical volumes through the lvcreate-L 100m-n lv1 vg1 command
The content in the red box is the size and name of the new logical volume and created in that volume group at a time.
(6) create a mount point
# mkdir / mnt/test
(7) establish a file system
# mkfs.ext4 / dev/vg1/lv1
(8) Mount the file system (boot auto mount can be set in / etc/fstab)
# mount / dev/vg1/lv1 / mnt/test
Operation 2: expand the logical volume
(1) extended volume group: vgextend vg1 / dev/vdd1
At this time, the logical volume has not been expanded.
(2) extended logic volume: lvextend-L + 20g / dev/vg1/lv1
At this time, the file system has not been expanded.
(3) expand the file system
For the ext4 file system, the command is: resize2fs / dev/vg1/lv1
If the file system of / dev/vg1/lv1 is xfs, the command is: xfs_growfs / dev/vg1/lv1
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.