• A+







Red Hat Enterprise Linux 5, 6, 7 &8
Filesystem: Ext2/3/4/xfs
LVM Physical Volume (PV) is on whole disk (no partitions)


A LUN has been extended and we need to get the OS to recognize the new storage space
Both the block device and multipath devices need to be resized
We need to extend our pv, vg, and lv which are using the entire device, not partitions
We need to extend the filesystem
Underlying device of the PV has been extended from storage end. How to get the additional size reflected in the PV, VG.


If you have this specific scenario, you can use the following steps:

Note: if these lv's are part of a clustered vg, steps 1 and 2 need to be performed on all nodes.注意:集群模式下步骤1和步骤2两个节点都需要执行。

1) Update block devices

# echo 1 > /sys/block/sdX/device/rescan

Note: This step needs to be run against any sd devices mapping to that lun. When using multipath, there will be more than one. 通过multipath -ll命令查看每个聚合卷对应的路径。

2) Update multipath device

# multipathd -k'resize map mpathX'


where mpathX = the multipath device mapped to the lun, i.e. (gathered from pvs -av output):

 /dev/mpath/36001f93103630000002e000200000000  vg_name    lvm2 a-      1.37T     0     1.37T Pd2u39-f1aG-o2fl-lTtW-C8x0-HYt6-wHxMSz

would be:

 # multipathd -k'resize map 36001f93103630000002e000200000000'
Note: at this point, it is important to verify that the appropriate size is now shown for both sd devices and mpath devices. You can verify this with 'pvs -av' output

3) Resize the physical volume, which will also resize the volume group

# pvresize /dev/mapper/mpathx

4) Resize your logical volume (the below command takes all available space in the vg)

# lvresize -l +100%FREE /path/to/logical/volume

5) Resize your filesystem

For ext4 filesystem use resize2fs
# resize2fs /path/to/logical/volume
For xfs filesystem use xfs_growfs
# xfs_growfs /path/to/logical/volume

6) Verify vg, lv and filesystem extension has worked appropriately

# vgs
# lvs
# df -h

Root Cause

  • In this particular scenario, it is possible to update all applicable information on-line. When using partitions, it is necessary to either extend the partition (which can not be done online) or create new partitions (which should only be done online by those with advance storage and filesystem knowledge).
  • If you are adding a new LUN, please refer to the following articles, which cover adding a new SCSI device, and creating a new PV on that device:


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: