Centos下lvm扩容详解

2020-01-30 15:46:53王旭

因生产需要对/data目录进行扩容,由原来的90G扩容到190G,增加100G的空间.

生产环境是RHEL服务器,后端通过光纤交换机连的EMC存储。首先在EMC存储上把空闲的硬盘做RAID,划分LUN,映射到生产RHEL服务器。

(注意:此种扩容的前提是分区必须采用LVM格式完成)

一、原服务器磁盘信息

#df -H

/dev/datavg/lv_data

                      90G   81G   9G  90% /data

#lvdisplay

--- Logical volume ---

LV Name                /dev/datavg/lv_data

VG Name                datavg

LV UUID                Sgpcu1-7Xhr-0gwH-qjJ6-QwBB-k2KA-9DJvFt

LV Write Access        read/write

LV Status              available

# open                 1

LV Size                90.00 GB

Current LE             24882

Segments               10

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

 Block device           253:1

二、重启服务器,识别到EMC上新加的LUN后,在服务器端进行扩容datavg卷

#powerrmt display dev=all

Pseudo name=emcpowery

CLARiiON ID=CKM00110900942 [SG_DRAGON]

Logical device ID=6006016003602C00F0154D04917BE011 [LUN 211]

state=alive; policy=CLAROpt; priority=0; queued-IOs=0;

Owner: default=SP A, current=SP A       Array failover mode: 1

==============================================================================

--------------- Host ---------------   - Stor -   -- I/O Path --  -- Stats ---

###  HW Path               I/O Paths    Interf.   Mode    State   Q-IOs Errors

==============================================================================

7 qla2xxx                  sdan      SP B0     active  alive       0      0

5 qla2xxx                  sdas      SP B1     active  alive       0      0

7 qla2xxx                  sdbo      SP A1     active  alive       0      0

5 qla2xxx                  sdq       SP A0     active  alive       0      0