51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

linux 出现 Assuming drive cache: urite throuqh

centos 虚拟机 出现如下提示:"assuming drive cache:write through"

5.812026] sd 0:::: [sdal Assuming drive cache: urite throuqh
Metadata corruption detected at xfs_agf_verify+0x160/0x1c日 [xfs], xfs_agf6.733027] XFS (dm-g):block 0x186689167330761XFSCdma:Unmount and run xfs repair6.7338951Xes(dm-e:First128 butes of corruptedbuffermetadataE080003B9180306.7331201ffff8aZe19bda20g:584146 99 90cdgXAGF........8.0069g8E9200B0586BEB8E880g026.7331521ffffBaze19bdaz1g:福82名0096888E636.7331831e19hda26ge8800r06aE8B90166.7332131gtC69e816733244124日:8916geBB009g9ge6 7332751258:9ggg9geegg................67333051gg9ggg0BBB9ggg eg egffffBaZe19bda26日:g99ggg9g................ffffBaZe19bda270: 00gg ag egg gg 95 9067333361ggg9g9g99 . . .. . . . map" at daddr 9x18668916.733402] XFS (dm-g): metadataI/0errorxfstransreadbuflen1error 117
...............
..C..........
。。。。。。.。。...。...
jy...D...w.....
Generating"/run/initramfs/rdsosreport .txt'
Entering emergency mode. Exit the shell to continueTupe "journalctl" to view system logs.You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /bootaftermounting them and attach it to a bug report.

**可能原因:**虚拟机不正常关机

  1. 根据屏幕提示会让你输入 journalctl 进入到系统Log查看日志

    journalctl

然后按shift+g从最后面查找关键信息

Jul 26 06:0?:11Kernel:XFs(dm-g):Corruption warning: Metadata has LSN (2027:4082)Jul 26 96:97:11XFS(dm-g): Metadata corruption detected at xfs agi_verify+0xkernel:Jul 26 06:0?:11kernel:XFS (dm-g): Unmount and run xfs repairbuzeeJul 26 96:92:11XFS (dm-g): First128 butes of corruptedmetadata buffer :huzEEkernel:Jul 26 06:0?:11dashuz9ekernel:ffff92791a4b4en0 :5841 47 49909999190990909030CbaimeJul 26 86:0?:11 baimeidashu20gkernel:ffff92791a4b4e18: 00 02 5b 80 08 00 03 80 00 00 a8 02 00 00 aJul 26 06:0?:11baimeffff92?91a4b4e2a: @g @g cf ca ff ff ff ff ff ff ff ff ff ff fkernel:Jul 26 06:0?:11ffff92791a4b4e3g: ff ff ff ff ff ff ff ff ff ff ff ff ff ff fbaiidashuztNkernel :Jul26 06:97:11ffff92791a4b4e4g: ff ff ff ff ff ff ff ff ff ff ff ff ff ff fbaiwdashuzgnkerne .ul26 06:9?:11uz9Gffff92?91a4b4e5g: ff ff ff ff ff ff ff ff ff ff ff ff ff ff fbaimkernel:u26 06:97:11kernel:ffff92?91a4b4e6g: ff ff ff ff ff ff ff ff ff ff ff ff ff ff fbaimeZEffff92791a4b4e7日:  05 99 52 ff ff ff ff ff ff ff ff ff ff fJul26 96:97:11bain6uzEEkernelIul26 96:97:11XFS (dm-g): metadata l/0 error in "xfs trans read buf map" atbahUZEEKerneJul2696:97:11XFS(dm-g): xfs imap_lookup: xfs ialloc read agi() returned ebaiashyykernel:ul26 06:87:11baimeidashu2gEXFS(dm-8): Failed to read root inode x4日,error 11?kernel:ul2696:97:11 baimeimount[429]:mount: mount /dev/mapper/centos-root on /sysroot failed:Jul26 06:97:11sysroot.mount mount process exited, code=exited status=32baimcsustendlJul26 96:97:11Failedto mount /susrootbaiasSUSTeMJul26 96:97:11DependencyfailedInitrd Root File SustemtorJul26 06:87:1129Efailed for Reload Conf iquration from the RealbaimsustemDependencuJul26 96:97:11Job initrd-parse-etc.service/start failed with result 'debauJul 26 06:07:11ba1Trigger ingOnFailure= dependencies of initrd-parse-etc.seJu l26 96:97:11Job initrd-root-fs.target/start failed with result 'depenbaul26 96:97:11Iriggering OnFailure= dependencies of initrd-root-fs.targ6aJu l26 06:07:11baimeUnit susroot.mount entered failed state.Jul2696:92:11baimeReached target Initrd File Sustems .Jul 26 06:07:11baiStoppeddracutinitqueue hookJul2696:97:11pre-udev hook .stoppeddracutJul26 96:97:1dracutcmdline hook stoppedJul26 06:07:11targetBasic Sustem.StoppedJul26 96:07:11target Sustem Initialization .StoppedJul 26 06:?:11baimeStartedEmergency Shell.buzeJul26 06:07:11idashuzgfReachedtarget Emergency Mode.Jul 26 06:0?:11baimeidashu290sustemd[1:Startupfinished in 1.006s (kernel) + 日 (initrd) + 1.548sJul 26 06:9?:11 baimeidashu20gsystemd[1]: ReceivedSIGRTMIN+21 from PID 299 (plymouthd)Jul 26 06:0?:49 baimeidashu209kernel: random: crnginit done

从这一句中可以知道/dev/mapper/rhel-root挂载到/sysroot失败

1.首先尝试mount和umount文件系统,以便重放日志,修复文件系统,如果不行,再进行如下操作。

  1. 检查文件系统
    做此步之前确保分区处于umount状态
    xfs_check /dev/sdd(盘符); echo $?
    返回0表示正常

我这里没有 xfs_check 工具, 没关系,继续下一步

  1. 执行xfs_repair -n,检查文件系统是否损坏,如何损坏会列出将要执行的操作
    执行xfs_repair -n,检查文件系统是否损坏,如何损坏会列出将要执行的操作

  2. 执行xfs_repair修复文件系统
    xfs_repair /dev/mapper/rhel-root (ext系列工具为fsck)

    xfs_repair /dev/mapper/centos-root

  3. 最后方法:损失部分数据的修复方法
    根据打印消息,修复失败时:

先执行xfs_repair -L /dev/mapper/rhel-root(清空日志,会丢失文件),

xfs_repair -L /dev/mapper/centos-root

再执行xfs_repair /dev/mapper/rhel-root,

xfs_repair /dev/mapper/centos-root

再执行xfs_check /dev/mapper/rhel-root 检查文件系统是否修复成功。

说明:-L是修复xfs文件系统的最后手段,慎重选择,它会清空日志,会丢失用户数据和文件。

备注:在执行xfs_repair操作前,最好使用xfs_metadump工具保存元数据,一旦修复失败,最起码可以恢复到修复之前的状态。

6- 检查是否修复成功, 若返回0则表示修复成功

echo $?

再次挂载/dev/mapper/rhel-root, 若返回0则表示挂载成功

mount /dev/mapper/centos-root /sysroot;echo $?

exit

退出修复模式若能成功进入系统则修复完成

RadHat/Centos启动失败出现Assuming drive cache: write through 或 Metadata corruption - 墨天轮 (modb.pro)

赞(4)
未经允许不得转载:工具盒子 » linux 出现 Assuming drive cache: urite throuqh