背景:
其中
/dev/vda1 系统盘
/dev/vdb1 挂载到文件夹wwwroot上的单独一个云磁盘,放置网站数据用
原数据放置于系统盘上文件夹wwwroot,买了新云盘后,将wwwroot命名为wwwrootB,新建一个文件夹wwwroot,并将格式化后的新云磁盘挂载到wwwroot上。
使用一直正常,今天该主机上某个网站dedecms后台新建栏目,提示无法创建,ssh到服务器上,检查文件夹权限,正常。
放置于其上的WordPress使用正常,上传图片、发布文章均正常
期初怀疑是因为lnmp有跨站保护,需要修改.user.ini后方可更改文件中的文件,
立即命令修改
1 | chattr -i /.user.ini |
系统提示如下
1 | Read-only file system while setting flags on ./.user.ini |
使用以下命令查看文件系统的是否可写
1 | cat /proc/mounts |
输出如下:
1 2 3 4 5 6 7 8 9 10 | 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属性
1 | mount -o remount,rw /home/wwwroot |
不成功,提示写保护
1 | cannot remount block device /dev/vdb1 read-write, is write-protected |
继续
dmesg
查到有很多报错,看来文件系统有错误
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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 |
以为是文件系统错误导致的,修复之,注意:关闭正在运行的服务,不关闭容易损坏文件系统
先关闭服务
1 | lnmp stop |
然后使用以下命令
1 | fsck -y |
不行,提示如下
1 2 3 4 | fsck from util-linux-ng 2.17.2 e2fsck 1.41.12 (17-May-2010) /dev/vda1 is mounted. e2fsck: Cannot continue, aborting. |
最后找到了原因…………还要再格式化一次,再mount……………
原文链接:https://xiaohost.com/1577.html,转载请注明出处。
评论7