我试图在我已经增长的多路径卷上调整文件系统的大小,重新扫描所有磁盘,并调整多路径映射的大小。
# resize2fs /dev/mapper/my_vol
resize2fs 1.43-WIP (20-Jun-2013)
Filesystem at /dev/mapper/my_vol is mounted on /var/lib/myvol; on-line resizing required
old_desc_blocks = 6, new_desc_blocks = 12
resize2fs: Permission denied to resize filesystem
# strace -f resize2fs /dev/mapper/my_vol
(finishes with)
....snip....
write(1, "Filesystem at /dev/mapper/my_vol"..., 101Filesystem at /dev/mapper/my_vol is mounted on /var/lib/myvol; on-line resizing required
) = 101
write(1, "old_desc_blocks = 6, new_desc_bl"..., 42old_desc_blocks = 6, new_desc_blocks = 12
) = 42
access("/sys/fs/ext4/features/meta_bg_resize", R_OK) = 0
open("/var/lib/my_vol", O_RDONLY) = 4
ioctl(4, 0x40086610, 0x7fffb729c2e8) = -1 EPERM (Operation not permitted)
write(2, "resize2fs", 9resize2fs) = 9
write(2, ": ", 2: ) = 2
write(2, "Permission denied to resize file"..., 38Permission denied to resize filesystem) = 38
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(2, "\n", 1
) = 1
exit_group(1) = ?
我想保持这台服务器运行,因为它托管了许多虚拟机,并且我以前在以 root 身份运行 resizefs 时没有遇到权限被拒绝的情况,有什么可能拒绝 root 进行简单的调整大小?非常感谢任何帮助。
服务器禁用了 selinux,多路径 -ll 显示卷处于读写状态。(wp=rw)
myvol (3600c0ff00013d24d8c20725301000000) dm-12 HP,P2000 G3 iSCSI
size=186G features='1 queue_if_no_path' hwhandler='0' wp=rw
我注意到挂载点上的 ls -ld 显示
drwxr-xr-x 5 root root 4096 Jan 27 12:49 myvol
并不是
drwxr-xr-x. 5 root root 4096 Jan 27 12:49 myvol
#ls -Zd myvol
drwxr-xr-x root root ? myvol
有关的?
同样的问题——原来我的 FS 有一些不一致的地方:
/dev/mapper/
可能包含块设备而不是符号链接。如果是这样,请删除它们,运行udevadm trigger
. 为 Debian 7.8 工作。我最终不得不从操作系统磁盘映像启动我的机器并使用 Linux 救援模式来允许我运行手动 fsck -y /dev/****** 来修复我的文件系统。
之后 resize2fs 工作正常。