我正在 Centos 6.5 服务器上从存储阵列安装卷。我调整了卷的大小并尝试调整服务器上的 FS 大小,但 resize2fs 不会调整大小。
我没有使用 LVM。我使用 /etc/fstab 中的条目将 /dev/mapper 设备直接安装在挂载点上。
请注意,我下载并构建了 e2fsprogs-1.43.5,以消除 centos 6.5 附带版本中存在错误的可能性。使用了构建的 mke2fs 和 resize2fs。
我错过了什么?
谢谢。
- On storage array: Created 1TB volume
Name Size Source Created Serial
test-resize 1T - 2017-08-05 20:52:47 MDT 8A6E42D13A7D45AE00011014
- On server: rescan found multiple devices for the volume
[root@init105-12 hariharan]# rescan-scsi-bus.sh
...
4 new or changed device(s) found.
[7:0:0:2]
[8:0:0:2]
[9:0:0:2]
[10:0:0:2]
[root@init105-12 hariharan]# ll /dev/mapper
total 0
lrwxrwxrwx 1 root root 7 Aug 5 20:52 3624a93708a6e42d13a7d45ae00011010 -> ../dm-2
lrwxrwxrwx 1 root root 7 Aug 5 20:53 3624a93708a6e42d13a7d45ae00011014 -> ../dm-3 <--- new volume
crw-rw---- 1 root root 10, 58 Aug 3 17:50 control
lrwxrwxrwx 1 root root 7 Aug 3 17:50 vgroot-lvroot -> ../dm-1
lrwxrwxrwx 1 root root 7 Aug 3 17:50 vgroot-lvswap01 -> ../dm-0
[root@init105-12 hariharan]# service multipathd reload
Reloading multipathd: [ OK ]
[root@init105-12 hariharan]# mke2fs -t ext4 -O 'has_journal,ext_attr,resize_inode,dir_index,filetype,extent,flex_bg,sparse_super,huge_file,uninit_bg,dir_nlink,extra_isize,large_file' /dev/mapper/3624a93708a6e42d13a7d45ae00011014
- On storage array: Resized volume to 2TB
Name Size Source Created Serial
test-resize 2T - 2017-08-05 20:52:47 MDT 8A6E42D13A7D45AE00011014
- On server
[root@init105-12 hariharan]# resize2fs /dev/mapper/3624a93708a6e42d13a7d45ae00011014
resize2fs 1.43.5 (04-Aug-2017)
The filesystem is already 268435456 (4k) blocks long. Nothing to do!
- Try rescan & multipathd restart - did not help
[root@init105-12 hariharan]# rescan-scsi-bus.sh
...
0 new or changed device(s) found.
0 remapped or resized device(s) found.
[root@init105-12 hariharan]# service multipathd reload
Reloading multipathd: [ OK ]
[root@init105-12 hariharan]# resize2fs /dev/mapper/3624a93708a6e42d13a7d45ae00011014
resize2fs 1.43.5 (04-Aug-2017)
The filesystem is already 268435456 (4k) blocks long. Nothing to do!
答案1
此序列似乎产生了一致的结果。(注意:当我尝试此测试时,我很确定我能够在没有任何参数的情况下运行 rescan-scsi-bus.sh 来查找 storage.array 上的新卷。现在我必须指定-我查找新卷。如果没有它,重新扫描将找不到新卷。服务器和阵列通过光纤通道连接。)
在创建卷和调整大小后,我使用了相同的命令序列。
rescan-scsi-bus.sh -r -i
sleep 5
service multipathd reload
ll /dev/mapper/
sleep 5
lsblk /dev/mapper/3624a93708a6e42d13a7d45ae0001101f
Resize works:
[root@init105-12 hariharan]# resize2fs /dev/mapper/3624a93708a6e42d13a7d45ae0001101e
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/mapper/3624a93708a6e42d13a7d45ae0001101e to 536870912 (4k) blocks.
The filesystem on /dev/mapper/3624a93708a6e42d13a7d45ae0001101e is now 536870912 blocks long.