linux服务器通过multipath多路径连接到共享存储,那么当文件系统空间不足的时候,有几种方式可以扩展文件系统的大小: 1、pv不变,原lun存储扩大容量,扩大lv,扩大文件系统 2、新增pv,加入到vg中,扩大lv,扩大文件系统 下文是针对场景1的情况下如何操作(但是个人建议采取新建pv的方式2进行): EnvironmentRedHatEnterpriseLinux5,6,78Filesystem:Ext234xfsLVMPhysicalVolume(PV)isonwholedisk(nopartitions)IssueALUNhasbeenextendedandweneedtogettheOStorecognizethenewstoragespaceBoththeblockdeviceandmultipathdevicesneedtoberesizedWeneedtoextendourpv,vg,andlvwhichareusingtheentiredevice,notpartitionsWeneedtoextendthefilesystemUnderlyingdeviceofthePVhasbeenextendedfromstorageend。HowtogettheadditionalsizereflectedinthePV,VG。LUN已扩展,我们需要让操作系统识别新的存储空间块设备和多路径设备都需要调整大小我们需要扩展pv、vg和lv,它们使用的是整个设备,而不是分区我们需要扩展文件系统PV的底层设备已从存储端扩展。如何获得PV、VG中反映的附加尺寸。Resolution Ifyouhavethisspecificscenario,youcanusethefollowingsteps: Note:iftheselvsarepartofaclusteredvg,steps1and2needtobeperformedonallnodes。注意:集群模式下步骤1和步骤2两个节点都需要执行。 1)Updateblockdevicesecho1sysblocksdXdevicerescan Note:Thisstepneedstoberunagainstanysddevicesmappingtothatlun。Whenusingmultipath,therewillbemorethanone。通过multipathll命令查看每个聚合卷对应的路径。 2)UpdatemultipathdevicemultipathdkresizemapmpathX 例子:wherempathXthemultipathdevicemappedtothelun,i。e。(gatheredfrompvsavoutput):devmpath36001f93103630000002e000200000000vgnamelvm2a1。37T01。37TPd2u39f1aGo2fllTtWC8x0HYt6wHxMSzwouldbe:multipathdkresizemap36001f93103630000002e000200000000Note:atthispoint,itisimportanttoverifythattheappropriatesizeisnowshownforbothsddevicesandmpathdevices。Youcanverifythiswithpvsavoutput 3)Resizethephysicalvolume,whichwillalsoresizethevolumegrouppvresizedevmappermpathx 4)Resizeyourlogicalvolume(thebelowcommandtakesallavailablespaceinthevg)lvresizel100FREEpathtologicalvolume 5)ResizeyourfilesystemForext4filesystemuseresize2fsresize2fspathtologicalvolumeForxfsfilesystemusexfsgrowfsxfsgrowfspathtologicalvolume 6)Verifyvg,lvandfilesystemextensionhasworkedappropriatelyvgslvsdfh模拟环境实验使用targetcli模拟共享存储映射给客户端,并模拟多路径磁盘,共享磁盘为testlvoiqn。202112。iscsi。local:oradb202。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔TPGs:1〕otpg1。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔nogenacls,noauth〕oacls。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔ACLs:1〕oiqn。202112。iscsi。local:oradb202。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔MappedLUNs:1〕omappedlun0。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔lun0block202test(rw)〕oluns。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔LUNs:1〕olun0。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔block202test(devmapperdatatestlv)(defaulttgptgp)〕oportals。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔Portals:1〕o192。168。5。100:3100。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔OK〕oiqn。202112。iscsi。local:oradb20201。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔TPGs:1〕otpg1。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔nogenacls,noauth〕oacls。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔ACLs:1〕oiqn。202112。iscsi。local:oradb202。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔MappedLUNs:1〕omappedlun0。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔lun0block202test(rw)〕oluns。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔LUNs:1〕olun0。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔block202test(devmapperdatatestlv)(defaulttgptgp)〕oportals。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔Portals:1〕o192。168。5。100:3100。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔OK〕oloopback。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。〔Targets:0〕 模拟存储端扩容testlv增加lvextendL1GdevdatatestlvSizeoflogicalvolumedatatestlvchangedfrom3。00GiB(768extents)to4。00GiB(1024extents)。Logicalvolumedatatestlvsuccessfullyresized。从3G增加到4G。 查看客户端多路径情况multipathllmpatha(36001405413ebf5b0e284a739dd2f225f)dm4LIOORG,202testsize3。0Gfeatures0hwhandler0wprwpolicyservicetime0prio1statusactive41:0:0:0sdc8:32activereadyrunningpolicyservicetime0prio1statusenabled40:0:0:0sdd8:48activereadyrunning客户端存储空间仍为3G,可以看到子路径有sdc及sdd两条路径 客户端更新存储echo1sysblocksdcdevicerescanecho1sysblocksdddevicerescanmultipathll查看聚合磁盘无变化mpatha(36001405413ebf5b0e284a739dd2f225f)dm4LIOORG,202testsize3。0Gfeatures0hwhandler0wprwpolicyservicetime0prio1statusactive41:0:0:0sdc8:32activereadyrunningpolicyservicetime0prio1statusenabled40:0:0:0sdd8:48activereadyrunning 更新聚合设备multipathdkresizemapmpathaok返回OK〔rootoradb202〕multipathllmpatha(36001405413ebf5b0e284a739dd2f225f)dm4LIOORG,202testsize4。0Gfeatures0hwhandler0wprw磁盘大小已更新为3Gpolicyservicetime0prio1statusactive41:0:0:0sdc8:32activereadyrunningpolicyservicetime0prio1statusenabled40:0:0:0sdd8:48activereadyrunning 更新pv空间〔rootoradb202〕pvsPVVGFmtAttrPSizePFreedevmappermpathadatavglvm2a2。97g0当前pv无剩余空间devsda2rhellvm2a61。00g2。00gYouhavemailinvarspoolmailroot〔rootoradb202〕pvresizedevmappermpatha执行pvresizePhysicalvolumedevmappermpathachanged1physicalvolume(s)resizedorupdated0physicalvolume(s)notresized〔rootoradb202〕pvsPVVGFmtAttrPSizePFreedevmappermpathadatavglvm2a3。97g1。00gpv剩余1G空间devsda2rhellvm2a61。00g2。00g〔rootoradb202〕 更新lv空间〔rootoradb202〕lvresizel100FREEdevmapperdatavgdatalvSizeoflogicalvolumedatavgdatalvchangedfrom2。97GiB(760extents)to3。97GiB(1016extents)。Logicalvolumedatavgdatalvsuccessfullyresized。 更新文件系统空间〔rootoradb202〕xfsgrowfsdevmapperdatavgdatalvmetadatadevmapperdatavgdatalvisize512agcount4,agsize194560blkssectsz512attr2,projid32bit1crc1finobt0spinodes0databsize4096blocks778240,imaxpct25sunit0swidth0blksnamingversion2bsize4096asciici0ftype1loginternalbsize4096blocks2560,version2sectsz512sunit0blks,lazycount1realtimenoneextsz4096blocks0,rtextents0datablockschangedfrom778240to1040384〔rootoradb202〕dfhFilesystemSizeUsedAvailUseMountedondevmapperrhelroot20G12G8。1G60devtmpfs7。8G07。8G0devtmpfs10G010G0devshmtmpfs7。8G90M7。7G2runtmpfs7。8G07。8G0sysfscgroupdevsda11014M233M782M23bootdevmapperrhelhome5。0G3。7G1。3G75homedevmapperrhelu0130G26G4。9G84u01tmpfs1。6G12K1。6G1runuser42tmpfs1。6G01。6G0runuser1101tmpfs1。6G01。6G0runuser0devmapperdatavgdatalv4。0G33M4。0G1mnt〔rootoradb202〕