传统分区概念 | LVM逻辑卷管理 | |
磁盘空间独立性 | 不能充分利用,尤其是一个FS只能对应一个分区 | 多磁盘PV组成存储池VG,再根据应用细分逻辑卷LV,空间利用率提高 |
空间扩展性 | 重新分区 | 采取静态或动态在线扩展卷组容量 |
数据备份 | 业务繁忙时,I/O接口读写频繁 | 可采取快照方式捕捉某一逻辑卷的瞬间精确拷贝已完成在线备份工作 |
用户使用性 | 分区标识无法满足大量用户要求 | 可根据用户需求定义lv逻辑卷的卷标 |
1.搭建环境:OS:RHEL5.3
LVM包
IDE磁盘/dev/hdb(1024MB),/dev/hdd(1024MB)
2.转换磁盘分区――>lvm卷分区
最终方案:/dev/hdb ――> 创建 /dev/hdb1(Id:5,System:Extended)
/dev/hdb5(Id:8e,System:Linux LVM)
/dev/hdd ――> 创建 /dev/hdd1(Id:5,System:Extended)
/dev/hdd5(Id:8e,System:Linux LVM)
操作:(仅以/dev/hdb为例)
|
1.创建PV盘
方案: /dev/hdb ――> lvm2[1024MB]
/dev/hdd ――> lvm2[1024MB] 操作:
#pvcreate /dev/hdb5 /dev/hdd5 #pvscan #pvdisplay "/dev/hdb5" is a new physical volume of "1023.69 MB" --- NEW Physical volume --- PV Name /dev/hdb5 VG Name PV Size 1023.69 MB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID zM7103-SJg4-ZjOb-BeL0-dlR1-HHh6-HCG8kG "/dev/hdd5" is a new physical volume of "1023.69 MB" --- NEW Physical volume --- PV Name /dev/hdd5 VG Name PV Size 1023.69 MB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID hAk1Dx-QulA-YV4G-p8wa-7sWw-FiaC-10GorS |
方案: lvm2(/dev/hdb)――> vg1
lvm2(/dev/hdd)――> vg2
操作:
#vgcreate vg1 /dev/hdb5 #vgcreate vg2 /dev/hdd5 #vgscan #vgdisplay --- Volume group --- VG Name vg2 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 1020.00 MB PE Size 4.00 MB Total PE 255 Alloc PE / Size 0 / 0 Free PE / Size 255 / 1020.00 MB VG UUID Wa4Jo8-k3xY-BTng-uV6j-0Ee1-Vp8b-fNVrhQ --- Volume group --- VG Name vg1 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 1020.00 MB PE Size 4.00 MB Total PE 255 Alloc PE / Size 0 / 0 Free PE / Size 255 / 1020.00 MB VG UUID UGjfZd-shth-ZRTU-sVVm-MD0s-wzVB-zd7Uwt
|
方案: work(/dev/hdb5)――> vg1
Study(/dev/hdd5)――> vg2
操作:
#lvcreate �CL 500M �Cn work vg1 #lvcreate �CL 500M �Cn study vg2 #lvscan #lvdisplay --- Logical volume --- --- Logical volume ---
|
#mkfs.ext3 /dev/vg1/work //或 #mkfs -j /dev/vg1/work |
#mkdir ../home/work ../home/study
|