问题:
我有一个CentOS 7服务器,使用LUN存储数据,最近存储团队扩展了LUN空间。这是多路径-ll的输出
~ # multipath -ll
mpathc (3600601606cb04000a0eb35b80750eb11) dm-5 DGC ,VRAID
**size=27T** features='2 queue_if_no_path retain_attached_hw_handler' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| |- 1:0:0:2 sdl 8:176 active ready running
| `- 4:0:0:2 sdn 8:208 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 1:0:1:2 sdm 8:192 active ready running
`- 4:0:2:2 sdo 8:224 active ready running
以前的大小为20TB,现在已扩展到27TB。
这是fdisk coammnd的输出
fdisk -l /dev/mapper/mpathc
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/mapper/mpathc: 29686.8 GB, 29686813949952 bytes, 57982058496 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 4194304 bytes
Disk label type: gpt
Disk identifier: 843A6F7E-581A-455E-822F-2CE4306394BF
# Start End Size Type Name
1 8192 42949672926 20T Linux filesyste
可以看到LUN的大小和扇区增加。这是kpartx命令的输出
kpartx -l /dev/mapper/mpathc
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:Alternate GPT header not at the end of the disk.
GPT: Use GNU Parted to correct GPT errors.
mpathc1 : 0 42949664735 /dev/mapper/mpathc 8192
这是df命令的输出
df -h /dev/mapper/mpathc1
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/mpathc1 20T 17T 4.0T 81% /Splunk-Storage/COLD
我不知道如何在不释放数据的情况下扩展/dev/mapper/mpathc1的空间。我对建议都非常感谢
答案1:
步骤1:尝试重新扫描存储设备,告诉内核大小已更改,通过将内容写入rescan
文件来重新扫描存储设备:
echo > /sys/class/block/sdl/device/rescan
echo > /sys/class/block/sdm/device/rescan
echo > /sys/class/block/sdn/device/rescan
echo > /sys/class/block/sdo/device/rescan
扫描HBA也应该工作,SCSI HBA有scan
文件;将三个十进制数控制器,目标和LUN写入其中以扫描该LUN,或使用通配符"-"代替数字,以下扫描两个HBA上的controller 0上的所有设备:
echo "0 - -" > /sys/class/scsi_host/host1/scan
echo "0 - -" > /sys/class/scsi_host/host4/scan
步骤2:此时,内核知道/dev/mapper/mpathc
是27TB,检查它参数是否正确。
umount /dev/mapper/mpathc1
parted /dev/mapper/mpathc1 rm 1 mkpart primary 0% 100% print
在fdisk
过程之后,你可能必须使用kpartx
通知内核有关磁盘上的更改,因此,parted方法更容易,因此对我来说更安全。
步骤3:增加文件系统,首先,再次挂载它,如果是XFS,则必须挂载它,然后运行xfs_growfs
。
mount /dev/mapper/mpathc1 /Splunk-Storage/COLD
xfs_growfs /Splunk-Storage/COLD
如果是ext [234],运行resize2fs
,可以挂载或卸载。
resize2fs /dev/mapper/mpathc1
mount /dev/mapper/mpathc1 /Splunk-Storage/COLD