linux挂载的硬盘为ro,remount成rw出错问题解决笔记

老牛  2016-08-11 22:59  阅读 1,261 views 次 评论 0 条

背景:

其中
/dev/vda1 系统盘
/dev/vdb1 挂载到文件夹wwwroot上的单独一个云磁盘,放置网站数据用

原数据放置于系统盘上文件夹wwwroot,买了新云盘后,将wwwroot命名为wwwrootB,新建一个文件夹wwwroot,并将格式化后的新云磁盘挂载到wwwroot上。

使用一直正常,今天该主机上某个网站dedecms后台新建栏目,提示无法创建,ssh到服务器上,检查文件夹权限,正常。
放置于其上的WordPress使用正常,上传图片、发布文章均正常

期初怀疑是因为lnmp有跨站保护,需要修改.user.ini后方可更改文件中的文件,
立即命令修改

chattr -i /.user.ini

系统提示如下

Read-only file system while setting flags on ./.user.ini

使用以下命令查看文件系统的是否可写

cat /proc/mounts

输出如下:

rootfs / rootfs rw 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
devtmpfs /dev devtmpfs rw,relatime,size=947176k,nr_inodes=236794,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
/dev/vda1 / ext4 rw,relatime,barrier=1,data=ordered 0 0
/proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
/dev/vdb1 /home/wwwroot ext4 ro,relatime,barrier=1,data=ordered 0 0

wwwroot文件所挂载的磁盘为ro属性,即只读,随即使用以下命令改写为rw属性

mount -o remount,rw /home/wwwroot

不成功,提示写保护

cannot remount block device /dev/vdb1 read-write, is write-protected

继续
dmesg

查到有很多报错,看来文件系统有错误

EXT4-fs error (device vdb1): ext4_journal_start_sb: Detected aborted journal
EXT4-fs (vdb1): Remounting filesystem read-only
JBD: Spotted dirty metadata buffer (dev = vdb1, blocknr = 0). There's a risk of filesystem corruption in case of system crash.
EXT4-fs error (device vdb1) in ext4_orphan_add: Journal has aborted
EXT4-fs error (device vdb1) in ext4_reserve_inode_write: Journal has aborted
EXT4-fs error (device vdb1) in ext4_orphan_add: Journal has aborted
EXT4-fs error (device vdb1) in ext4_reserve_inode_write: Journal has aborted
EXT4-fs error (device vdb1) in ext4_orphan_add: Journal has aborted
EXT4-fs error (device vdb1) in ext4_reserve_inode_write: Journal has aborted
EXT4-fs error (device vdb1) in ext4_orphan_add: Journal has aborted
EXT4-fs error (device vdb1) in ext4_reserve_inode_write: Journal has aborted
EXT4-fs error (device vdb1): ext4_remount: Abort forced by user
EXT4-fs error (device vdb1): ext4_remount: Abort forced by user
EXT4-fs error (device vdb1): ext4_remount: Abort forced by user
EXT4-fs error (device vdb1): ext4_remount: Abort forced by user

以为是文件系统错误导致的,修复之,注意:关闭正在运行的服务,不关闭容易损坏文件系统
先关闭服务

lnmp stop

然后使用以下命令

fsck -y

不行,提示如下

fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
/dev/vda1 is mounted.
e2fsck: Cannot continue, aborting.

由于不敢轻易线上处理,先找找问题,待续

历史上的今天:

本文地址:http://xiaohost.com/1577.html
版权声明:本文为原创文章,版权归 老牛 所有,欢迎分享本文,转载请保留出处!

发表评论


表情