当文件系统变因为Detected aborted journal时filesystem read-only的解决方法

今天一台服务器日志分区突然间不能写操作,filesystem read-only。查看日志发现该分区有如下报错:

May 30 11:52:35 xxx kernel: Aborting journal on device dm-2.

May 30 11:52:35 xxx kernel: ext3_abort called.

May 30 11:52:35 xxx kernel: EXT3-fs error (device dm-2): ext3_journal_start_sb: Detected aborted journal

当文件系统变因为Detected aborted journal时filesystem read-only的解决方法

解决该问题首先需要卸载该目录

使用umount -f /var/log/命令无法完成,强制卸载。

[/root]#:umount -f /var/log/

umount2: Device or resource busy

umount: /var/log/: device is busy

umount2: Device or resource busy

umount: /var/log/: device is busy

使用fuser -cu命令检查是哪个进程占用该目录

[/root]#:fuser -cu /var/log/

/var/log/: 28063c

使用fuser -ck /var/log/来结束进程

[/root]#:fuser -ck /var/log/

/var/log/: 28063c

再次使用umount -f强制卸载

[/root]#:umount -f /var/log/

使用e2fsck -y命令来修复损坏的文件系统

[/root]#:e2fsck -y /dev/mapper/datavg00-lv_log_nb

e2fsck 1.39 (29-May-2006)

/dev/mapper/datavg00-lv_log_nb: recovering journal

/dev/mapper/datavg00-lv_log_nb has gone 911 days without being checked, 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/datavg00-lv_log_nb: ***** FILE SYSTEM WAS MODIFIED *****

/dev/mapper/datavg00-lv_log_nb: 14522412/52428800 files (0.9% non-contiguous), 44266052/104857600 blocks

You have new mail in /var/spool/mail/root

修复完成后,挂载正常,读写正常。

原创文章,作者:shengbao,如若转载,请注明出处:https://shengbao.org/42.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注

联系我们

400-800-8888

在线咨询:点击这里给我发消息

邮件:admin@shengbao.org

工作时间:周一至周五,9:30-18:30,节假日休息