AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 662715
Accepted
Sirch
Sirch
Asked: 2015-01-28 06:35:37 +0800 CST2015-01-28 06:35:37 +0800 CST 2015-01-28 06:35:37 +0800 CST

调整文件系统大小的权限被拒绝

  • 772

我试图在我已经增长的多路径卷上调整文件系统的大小,重新扫描所有磁盘,并调整多路径映射的大小。

# 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

有关的?

linux ext4
  • 3 3 个回答
  • 18473 Views

3 个回答

  • Voted
  1. nobody
    2015-08-07T09:40:13+08:002015-08-07T09:40:13+08:00

    同样的问题——原来我的 FS 有一些不一致的地方:

    # resize2fs /dev/blah/lvol0
    resize2fs 1.42.9 (28-Dec-2013)
    Filesystem at /dev/blah/lvol0 is mounted on /mnt/lvol0; on-line resizing required
    old_desc_blocks = 1, new_desc_blocks = 1
    resize2fs: Permission denied to resize filesystem
    
    # umount /mnt/lvol0
    
    # resize2fs /dev/blah/lvol0
    resize2fs 1.42.9 (28-Dec-2013)
    Please run 'e2fsck -f /dev/blah/lvol0' first.
    
    # fsck /dev/blah/lvol0
    fsck from util-linux 2.23.2
    e2fsck 1.42.9 (28-Dec-2013)
    /dev/mapper/blah-lvol0 contains a file system with errors, check forced.
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    /dev/mapper/blah-lvol0: 513/3072 files (2.9% non-contiguous), 12288/12288 blocks
    
    # mount /dev/blah/lvol0 /mnt/lvol0
    
    # resize2fs /dev/blah/lvol0
    resize2fs 1.42.9 (28-Dec-2013)
    Filesystem at /dev/blah/lvol0 is mounted on /mnt/lvol0; on-line resizing required
    old_desc_blocks = 1, new_desc_blocks = 1
    The filesystem on /dev/blah/lvol0 is now 225280 blocks long.
    
    • 9
  2. Best Answer
    Borkia
    2015-07-09T06:51:03+08:002015-07-09T06:51:03+08:00

    /dev/mapper/可能包含块设备而不是符号链接。如果是这样,请删除它们,运行 udevadm trigger. 为 Debian 7.8 工作。

    • 3
  3. NE1Scott
    2020-01-08T11:06:16+08:002020-01-08T11:06:16+08:00

    我最终不得不从操作系统磁盘映像启动我的机器并使用 Linux 救援模式来允许我运行手动 fsck -y /dev/****** 来修复我的文件系统。

    之后 resize2fs 工作正常。

    • -1

相关问题

  • 多操作系统环境的首选电子邮件客户端

  • 你最喜欢的 Linux 发行版是什么?[关闭]

  • 更改 PHP 的默认配置设置?

  • 保护新的 Ubuntu 服务器 [关闭]

  • (软)Ubuntu 7.10 上的 RAID 6,我应该迁移到 8.10 吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve