修复Linux系统“Read-only file system”错误的解决方案

根(/)文件系统在重新引导期间以只读模式挂载,并且多个systemd服务无法启动,并在 /var/log/messages 中出现“Read-only file system”错误。

Sep 22 00:44:15 shizhanxia.com systemd-tmpfiles[1281]: fchmod() of /tmp failed: Read-only file system
Sep 22 00:44:17 shizhanxia.com systemd[1]: chronyd.service: Failed with result 'resources'.
Sep 22 00:44:17 shizhanxia.com systemd[1]: Failed to start NTP client/server.
Sep 22 00:44:17 shizhanxia.com systemd[1]: systemd-shizhanxia.comd.service: Failed to run 'start' task: Read-only file system
Sep 22 00:44:17 shizhanxia.com systemd[1]: systemd-shizhanxia.comd.service: Failed with result 'resources'.
Sep 22 00:44:17 shizhanxia.com systemd[1]: Failed to start shizhanxia.com Service.
Sep 22 00:44:17 shizhanxia.com systemd[1]: systemd-journal-upload.service: Failed to run 'start' task: Read-only file system
Sep 22 00:44:42 shizhanxia.com kdumpctl[1455]: mktemp: failed to create directory via template ‘/tmp/mkdumprd.XXXXXX’: Read-only file system
Sep 22 00:44:48 shizhanxia.com rc.local[1401]: hwclock: cannot open /etc/adjtime: Read-only file system
Sep 22 00:44:48 shizhanxia.com systemd[1]: chronyd.service: Failed to run 'start' task: Read-only file system

检查根文件系统状态

# mount | grep -i ro
/dev/mapper/rhel-root on / type xfs (ro,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)
# touch testfile
touch: cannot touch 'testfile': Read-only file system

检查systemd-remount-fs服务活动状态。

# systemctl status systemd-remount-fs
● systemd-remount-fs.service - Remount Root and Kernel File Systems
   Loaded: loaded (/usr/lib/systemd/system/systemd-remount-fs.service; static; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:systemd-remount-fs.service(8)
           https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems

/tmp挂载条目位于/etc/fstab中。

# cat /etc/fstab
/dev/mapper/vg00-lv01    /tmp                    xfs     defaults        0 0

在启动过程中会记录“只读文件系统”错误。

# journalctl | grep Read-only
Sep 22 00:44:15 shizhanxia.com auditd[690]: Couldn't open log file /var/log/audit/audit.log (Read-only file system)
Sep 22 00:44:15 shizhanxia.com systemd-update-utmp[692]: Failed to write utmp record: Read-only file system
Sep 22 00:44:15 shizhanxia.com systemd[1]: chronyd.service: Failed to run 'start' task: Read-only file system
Sep 22 00:44:15 shizhanxia.com systemd[1]: chronyd.service: Failed to run 'stop-post' task: Read-only file system

解决方案

剩余内容需解锁后查看

您需要赞助解锁才能查看当前内容

赞助者赞助者免费
已付费?登录刷新

原创文章,作者:保哥,如若转载,请注明出处:https://www.shizhanxia.com/1070.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
保哥的头像保哥
上一篇 2024年6月26日 17:18
下一篇 2024年6月27日 11:38

相关推荐

发表回复

登录后才能评论
近期VMware公司在广泛地发律师函。本站也并非专门提供ISO镜像下载服务的站点,经慎重考虑,决定停止向各位赞助者提供该镜像的下载服务。由此带来的不便,我们深表歉意。