LVM创建实例讲解

LVM讲解:图像大纲:

1)LVM是什么,作用:LVM称为逻辑卷管理,作用是提高磁盘分区的管理和使用灵活性。通过逻辑卷LVM可以有效的管理和分配磁盘空间,可以把分散的小分区组合成一个大的卷组,从卷组中分出需要的空间做出逻辑卷,这样使得磁盘扩容和缩减方便易用。还有着备份的功能,指的就是lvm快照。2)创建实例: 磁盘-》分区-》ID修改8e-》保存。我用来一个磁盘通过分区来做的。还可以每个磁盘分一个区来做。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)创建物理卷:通过pvcreate命令。pvcreate /dev/sdb1 pvcreate /dev/sdb2 pvcreate /dev/sdb3 [root@station106 ~]# pvs(查看创建的物理卷)。 PV VG Fmt Attr PSize PFree /dev/sda2 vg0 lvm2 a– 59.99g 7.99g /dev/sdb1 lvm2 a– 10.00g 10.00g /dev/sdb2 lvm2 a– 10.00g 10.00g /dev/sdb3 lvm2 a– 10.00g 10.00g pvdisplay 查看更加详细的内容。

[root@station106 ~]# pvdisplay — Physical volume — PV Name /dev/sdb1 VG Name myvg PV Size 10.00 GiB / not usable 4.54 MiB Allocatable yes PE Size 4.00 MiB Total PE 2560Free PE 2560Allocated PE 0PV 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 2560Free PE 2560Allocated PE 0PV 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 2560Free PE 2560Allocated PE 0PV UUID rKNL0x-WXq2-gHYD-T27r-Gf05-a4y3-f4zqzt

4)创建逻辑卷:通过vgcreate。 [root@station106 ~]# vgcreate myvg /dev/sdb{1,2,3} Volume group “myvg” successfully created

[root@station106 ~]# vgs VG #PV #LV #SN Attr VSize VFree myvg 3 0 0 wz–n- 30.00g 30.00g

5)创建逻辑卷,lvcreate。[root@station106 ~]# lvcreate -L 10G -n test myvg Logical volume “test” created -L:空间大小。 -n:逻辑卷名称。 [root@station106 ~]# lvdisplay /dev/myvg/test — Logical volume — LV Path /dev/myvg/test LV Name test VG Name myvg LV UUID wY1YUF-f0o6-jzu1-mtTL-64p0-qvfC-3QfF8y LV Write Access read/write LV Creation host, time station106.magelinux.com, 2014-02-10 11:18:43 +0800LV Status available # open 0LV Size 10.00 GiB Current LE 2560Segments 1Allocation inherit Read ahead sectors auto – currently set to 256Block device 253:4

6)挂载使用创建好的逻辑卷。mke2fs -t ext4 /dev/myvg/test 格式化。 mount /dev/myvg/test /mnt/挂载使用。

放下一种执着,收获一种自在。放下既是一种理性抉择,也是一种豁达美。

LVM创建实例讲解

相关文章:

你感兴趣的文章:

标签云: