In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about how to mount logic volumes and expand logic volume groups in the linux system. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
1. Mount the logical volume:
1. Create a pv:
For example, the Linux system mounts two 100G disks / dev/vdb / dev/vdc
Partition two disks, all of which are divided into one zone by default:
Fdisk / dev/vdbfdisk / dev/vdc
Create a pv after partitioning
Pvcreate / dev/vdb1pvcreate / dev/vdc1
View the new physical volume created:
Pvdisplay
The output shows the created PV and related information
two。 Create a vg:
The created vg defaults to the full capacity of the two disks, so you do not need to specify a size
Vgcreate VgGroup / dev/sdb1 / dev/sdc1
Note: VgGroup is the name of vg.
View the created vg:
Vgdisplay
Note: the output shows the vg created and other related information. When you look at vg, notice how many PE there are in the vg logical volume group. You need to specify the number of PE when creating a LV.
3. Create a lv:
Create a lv:
Lvcreate-l 23482-n lv_data VgGroup
Note: 23482 is the number of PE viewed in vgdisplay, which also represents the capacity, lv-data is the name of the lv logical volume, and VgGroup is the name of the vg logical volume group.
4. Format the newly created lv:
Mkfs-t ext4 / dev/VgGroup/lv_data
Note: after creating a lv, a device folder with the name of vg will be created under / dev, which contains the created lv.
5. Mount the lv. After formatting, a lv device is generated under / dev, and a mount point is created to mount it:
Mkdir / datamount / dev/VgGroup/lv_data / data
8. Set up boot mount
Write / dev/VgGroup/lv_data ext4 defaults 0 0 to / etc/fstab
# / etc/fstab# Created by anaconda on Tue Jan 1 09:33:53 2013 March # Accessible filesystems, by reference, are maintained under'/ dev/disk'# See man pages fstab (5), findfs (8) Mount (8) and/or blkid (8) for more info#UUID=987c6563-147c-4ad4-94a7-1509fae850a7 / ext4 defaults 1 1UUID=e45077cd-10ab-4d3b-8b18-0fc86d539dab / boot ext4 defaults 1 2UUID=73130814-63b0-4789-b849-e4678c497480 swap swap defaults 0 0tmpfs / dev/shm tmpfs defaults 0 0devpts / dev/pts devpts gid=5 Mode=620 0 0sysfs / sys sysfs defaults 0 0proc / proc proc defaults 0 0/dev/VgGroup/lv_data / data ext4 defaults 0 0
Second, logical volumes increase partition space, and newly added disks need to be extended to existing disks.
(1) Partition the new disk ():
1:fdisk / dev/sdc
2: type n, add a partition, and get:
3: type p, primary partition, and type 3 (number):
4: default start sector and end sector (type Enter twice) type t, and modify the partition type to 8e:
5: type w, write the partition table, and then restart:
Note: you must restart, or you will not find additional partitions when creating physical volumes using pvcreate!
(2) initialize the partition and join the volume group
1: volume expansion, adding to LVM group
Pvcreate / dev/sdc1 initializes the partition just now
2: view the volume group and add the initialized partition to the virtual volume group
View vg group name
Vgdisplay
Add a new physical volume to the volume group vg_root sda3 to increase the capacity of the volume group
Vgextend vg_root / dev/sdc1
Eight: expand the size of logical volumes
1: only now can you expand the size of the logical volume and expand the capacity of root: /. The size in the command is specified according to the actual size of the new disk partition:
Lvextend-L + 10G / dev/mapper/vg_root-lv_root
2: finally, use the resizefs2 command to reload the size of the logical volume to take effect
Resize2fs / dev/mapper/vg_root-lv_root
3: then check the size of the extended logical volume again
Df-h above is the linux system shared by Xiaobian how to mount logical volumes and extended logical volume groups. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.