Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create LVM

2025-04-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

In this article, the editor introduces "how to create LVM" in detail, the content is detailed, the steps are clear, and the details are handled properly. I hope this "how to create LVM" article can help you solve your doubts.

LVM is short for Logical Volume Manager (logical Volume Management), which is implemented by Heinz Mauelshagen on the Linux 2.4 kernel. LVM collects the partitions of one or more hard disks logically, which is equivalent to a large hard disk to use. When the hard disk space is not enough, you can continue to add the partitions of other hard disks to it, which can realize the dynamic management of disk space. Compared with ordinary disk partitions, it has great flexibility.

LVM creation steps

1. Create Partition

two。 Create PV

3. Create VG

4. Create LV

5. Formatting and mounting

Create Partition

Use partition tools (such as fdisk, etc.) to create a LVM partition, but identify the partition as partition type 8e of LVM.

[root@kauai] # fdisk-l. Device Boot Start End Blocks Id System/dev/sdb1 2048 20971519 10484736 5 Extended/dev/sdb5 4096 2101247 1048576 8e Linux LVM/dev/sdb6 2103296 4200447 1048576 8e Linux LVM create PV

Create PV

[root@kauai ~] # pvcreate / dev/sdb5 # convert each partition to PV Physical volume "/ dev/sdb5" successfully created [root@kauai ~] # pvcreate / dev/sdb6 Physical volume "/ dev/sdb6" successfully created View and verify [root@kauai ~] # pvdisplay... Create VG

Create VG

[root@kauai ~] # vgcreate-s 16m vg01 / dev/sdb5 / dev/sdb6 / dev/sdb7# creates a VG group named vg01, and the PE is modified to 16mVolume group "vg01" successfully created to view and verify

Note: LVM defaults to the PE block of 4MB, so the default LVM VG will have 4M*65534/ (1024M/G) = 256g.

Create LV

5.1 create LVS [/ erji]

[root@kauai] # lvcreate-L 1g-n lv01 vg01 Logical volume "lv01" created. View and verify [root@kauai ~] # lvdisplay formatting and mounting

Formatting

[root@kauai ~] # mkfs.xfs / dev/vg01/lv01 # is formatted into the corresponding format meta-data=/dev/vg01/lv01 isize=256 agcount=4, agsize=65536 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 finobt=0data = bsize=4096 blocks=262144 Imaxpct=25 = sunit=0 swidth=0 blksnaming = version 2 bsize=4096 ascii-ci=0 ftype=0log = internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1realtime = none extsz=4096 blocks=0 Rtextents=0 mount [root@kauai ~] # mkdir / root/mylv01 # create a directory for mounting [root@kauai ~] # mount / dev/vg01/lv01 / root/mylv01/ # mount to the corresponding directory [root@kauai ~] # df-h # View and verify Filesystem Size Used Avail Use% Mounted on... / dev/mapper/vg01-lv01 1014M 33m 982m 4% / root/mylv01 boot mount [root@kauai] # vi / etc/fstab/dev/vg01/lv01 / root/mylv01 xfs defaults 0 0 # modified to boot mount read here, this article "how to create LVM" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it before you can understand it. If you want to know more about related articles, Welcome to 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: 211

*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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report