How to create Linux using LVM

  

LVM is a logical volume management, is a mechanism for disk partition management under Linux, I believe many people want to know how Linux creates LVM and LVM usage, so Xiaobian will target LVM Create and use a detailed introduction, let's learn together.

LVM explain:

Image Outline: What

1) LVM, the role:

LVM called the Logical Volume Manager, the role is Improve the management and flexibility of disk partitioning.

The logical volume LVM can effectively manage and allocate disk space. You can combine scattered small partitions into one large volume group, and divide the required space from the volume group to make a logical volume. Capacity expansion and reduction are easy to use. There is also a backup function, which refers to the lvm snapshot.

2) Create an instance:

Disk->Partition->ID Modify 8e-"Save.

I used a disk to do it through partitions. It is also possible to divide each disk into one zone.

Device Boot Start End Blocks Id System

/dev/sdb1 1 1306 10490413+ 8e Linux LVM

/dev/sdb2 1307 2612 10490445 8e Linux LVM

/dev/sdb3 2613 3918 10490445 8e Linux LVM

3) Create a physical volume: via the pvcreate command.

pvcreate /dev/sdb1

pvcreate /dev/sdb2

pvcreate /dev/sdb3

[root@station106 ~]# pvs(View Create Physical volume).

PV VG Fmt Attr PSize PFree

/dev/sda2 vg0 lvm2 a-- 59.99g 7.99g

/dev/sdb1 lvm2 a-- 10.00g 10.00g< Br>

/dev/sdb2 lvm2 a-- 10.00g 10.00g

/dev/sdb3 lvm2 a-- 10.00g 10.00g

pvdisplay See more details.

[root@station106 ~]# pvdisplay

--- Physical volume ---

PV Name /dev/sdb1

VG Name myvg< Br>

PV Size 10.00 GiB /not usable 4.54 MiB

Allocatable yes

PE Size 4.00 MiB

Total PE 2560

Free PE 2560

Allocated PE 0

PV UUID XP8QfA-WQDd-1v9p-QKxk-AztZ-Nr9e-QbN6Gu

--- Physical volume ---

PV Name /dev/sdb2

VG Name myvg

PV Size 10.00 GiB /not usable 4.58 MiB

Allocatable yes

PE Size 4.00 MiB

Total PE 2560

Free PE 2560

Allocated PE 0

PV UUID f8Dtdd-fV9e-1yB7-1B8P-21mU-CU2f-fQDAxe

--- Physical volume ---

PV Name /dev/sdb3

VG Name myvg

PV Size 10.00 GiB /not usable 4.58 MiB

Allocatable yes

PE Size 4.00 MiB

Total PE 2560

Free PE 256 0

Allocated PE 0

PV UUID rKNL0x-WXq2-gHYD-T27r-Gf05-a4y3-f4zqzt

4) Create a logical volume: via vgcreate.

[root@station106 ~]# vgcreate myvg /dev/sdb{1,2,3}

Volume group “myvg” successfully created
Previous1234Next 4 pages in total

Copyright © Windows knowledge All Rights Reserved