展开Raid后,在CentOS上调整XFS大小

我有一个使用xfs文件系统的Raid 6arrays上的16TB分区。

# df -hT Filesystem Type Size Used Avail Use% Mounted on /dev/sdc1 xfs 15T 7.4T 7.2T 51% /backup 

在添加了几个磁盘之后,我使用LSI Megaraid工具重build了RAID,虚拟驱动器在Megaraid中从16TB扩展到了29TB。 但是,当我尝试增长xfs系统时,大小没有改变。 命令“xfs_growfs / backup”立即返回,没有任何改变。

 # xfs_growfs /backup meta-data=/dev/sdc1 isize=256 agcount=15, agsize=268435455 blks = sectsz=512 attr=2, projid32bit=0 data = bsize=4096 blocks=3906469376, imaxpct=5 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal bsize=4096 blocks=521728, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 

我试过分手,也无法检测到新的尺寸。

 (parted) print /dev/sdc Model: LSI MR9271-4i (scsi) Disk /dev/sdc: 16.0TB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 1049kB 16.0TB 16.0TB xfs primary 

以前,我遵循这个指令来创buildXFS分区。 我没有使用LVM。

https://unix.stackexchange.com/questions/29078/how-to-partition-22tb-disk

更新我刚刚重新启动服务器,现在我可以看到分区是32TB使用parted,但我一直无法使用xfs_grow调整文件系统。 分割的工具不支持xfs。

 # parted /dev/sdc GNU Parted 2.1 Using /dev/sdc Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print /dev/sdc Error: The backup GPT table is not at the end of the disk, as it should be. This might mean that another operating system believes the disk is smaller. Fix, by moving the backup to the end (and removing the old backup)? parted: invalid token: /dev/sdc Fix/Ignore/Cancel? Fix/Ignore/Cancel? fix Warning: Not all of the space available to /dev/sdc appears to be used, you can fix the GPT to use all of the space (an extra 31251759104 blocks) or continue with the current setting? Fix/Ignore? fix Model: LSI MR9271-4i (scsi) **Disk /dev/sdc: 32.0TB** Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 1049kB 16.0TB 16.0TB xfs primary 

(分开)

您需要修改分区表以利用LUN扩展提供的空间。 使用fdisk ,通常是删除分区,并使用相同的起点和新终点重新创build分区。 parted方面也是如此。

完成此操作后,可以重新引导或使用类似partprobe的工具(假设挂载的设备未使用),一旦完成,请挂载文件系统并运行xfs_growfs /mountpoint 。 XFS增长工具仅适用于已安装的文件系统。

如果你使用lvm和没有分区的lun,你可以用一个简单的方法来完成:

  1. echo 1 > /sys/block/sdc/device/rescan
  2. pvresize /dev/sdc
  3. 你的lvm卷的lvresizelvextend
  4. xfs_growfs