由于机器异常关机导致今早发生两个问题。
问题一 centos7无法正常开机
报错:Failed to open /sysroot/etc/fstab:Input
处理方法:
xfs_repair /dev/dm-0
#如果报错:xfs_repair: cannot open /dev/dm-0: Device or resource busy ,则
umount /dev/mapper/centos-root
xfs_repair -v -L /dev/mapper/centos-root
reboot
参考文章:https://renwoxing.blog.csdn.net/article/details/108376058
问题二 mysql无法正常启动
启动mysql报错 InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 2105726655 and the end 2105726464. 看样子他checkpoint的范围点丢失了。
(通过 systemctl status mysqld.service 、 journalctl -xe 、/var/log/mysqld.log 日志得知 )
2021-08-12T02:14:25.512028Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2021-08-12T02:14:25.513270Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 2105726655 and the end 2105726464.
2021-08-12T02:14:25.513302Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-08-12T02:14:26.035408Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-08-12T02:14:26.035483Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-08-12T02:14:26.035508Z 0 [ERROR] Failed to initialize builtin plugins.
2021-08-12T02:14:26.035517Z 0 [ERROR] Aborting
处理方法:
#方法一:修改 my.cnf ,使用innodb_force_recovery=1,然后重启mysql。其数字范围1~6 。 慎用
[mysqld]
innodb_force_recovery=1
#方法二:
删除文件ib_logfile* ,删除之前要备份下ib_logfile0, ib_logfile1 ,然后重启
参考:
https://blog.csdn.net/yunhua12/article/details/81393572
END