使用lvm

创建pv

pvcreate /dev/sda3
pvcreate /dev/sda7

创建vg

vgcreate dbf2_vg /dev/sda3 /dev/sda7

创建lv

  • -i 指定跨PV的个数为2
  • -I 指定条带单元的大小,对应于I/O中数据单元块的大小;数值必须为2的幂,单位KB
  • -n 制定卷的名称
  • -L 卷的大小
#指定大小
lvcreate -n var_lv -L 10G dbf2_vg

#使用剩余所有空间
lvcreate -l +100%FREE   -n meta_lv dbf2_vg

#创建条带卷
lvcreate -L 2G -i2 -I 64   -n meta_lv dbf2_vg

查看lv情况

  1. 默认配置
[root@demo_node3 ~]# lvs --segment
  LV     VG     Attr       #Str Type   SSize  
  dbf_lv dbf_vg -wi-a-----    1 linear 447.13g
  dbf_lv dbf_vg -wi-a-----    1 linear 447.13g

[root@demo_node3 ~]# lvs -a -o+lv_layout,lv_role,stripes,devices
  LV     VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Layout     Role       #Str Devices    
  dbf_lv dbf_vg -wi-a----- 894.26g                                                     linear     public        1 /dev/sdb(0)
  dbf_lv dbf_vg -wi-a----- 894.26g                                                     linear     public        1 /dev/sdc(0)
  1. 条带化
[root@demo_node3 ~]# lvs --segment 
  LV     VG     Attr       #Str Type    SSize  
  dbf_lv dbf_vg -wi-ao----    2 striped 894.26g

[root@demo_node3 ~]# lvs -a -o+lv_layout,lv_role,stripes,devices
  LV     VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Layout     Role       #Str Devices                
  dbf_lv dbf_vg -wi-ao---- 894.26g                                                     striped    public        2 /dev/sdb(0),/dev/sdc(0)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.