问题发现
突然发现机器重启后很多服务都出现了问题,不仅如此,还无法对文件进行操作:
>mkdir test
mkdir: cannot create directory ‘test’: Read-only file system
排查问题
查看mount发现根目录被挂载为了read only:
>mount
.......
/dev/mapper/vg0-root on / type ext4 (ro,relatime,stripe=256,data=ordered)
.......
dmesg日志记录
筛选dmesg的结果可以看到,EXT4-FS出现了问题(dmesg | grep "EXT4-fs error"):
[ 124.369135] systemd-readahead[724]: Failed to open pack file: Read-only file system
[ 303.068201] EXT4-fs (dm-1): error count since last fsck: 9
[ 303.068274] EXT4-fs (dm-1): initial error at time 1591123830: ext4_find_entry:1318: inode 25430455
[ 303.068412] EXT4-fs (dm-1): last error at time 1591123878: ext4_wait_block_bitmap:516: inode 25430531
[ 549.490580] EXT4-fs (dm-1): Couldn't remount RDWR because of unprocessed orphan inode