由于断电,重启服务器后,LVM卷组出现错误:ata1.00 status drdy err unc

具体错误如下:

[plain]  view plain  copy
  1. ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0  
  2. ata1.00: BMDMA stat 0x24  
  3. ata1.00: failed command: READ DMA  
  4. ata1.00: cmd c8/00:08:20:b7:13/00:00:00:00:00/ef tag 0 dma 4096 in  
  5.          res 51/40:00:27:b7:13/40:00:10:00:00/ef Emask 0x9 (media error)  
  6. ata1.00: status: { DRDY ERR }  
  7. ata1.00: error: { UNC }  
  8. ata1.00: configured for UDMA/133  
  9. ata1: EH complete  
  10. ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0  
  11. ata1.00: BMDMA stat 0x24  
  12. ata1.00: failed command: READ DMA  
  13. ata1.00: cmd c8/00:08:20:b7:13/00:00:00:00:00/ef tag 0 dma 4096 in  
  14.          res 51/40:00:27:b7:13/40:00:10:00:00/ef Emask 0x9 (media error)  
  15. ata1.00: status: { DRDY ERR }  
  16. ata1.00: error: { UNC }  
  17. ata1.00: configured for UDMA/133  
  18. ata1: EH complete  
  19. ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0  
  20. ata1.00: BMDMA stat 0x24  
  21. ata1.00: failed command: READ DMA  
  22. ata1.00: cmd c8/00:08:20:b7:13/00:00:00:00:00/ef tag 0 dma 4096 in  
  23.          res 51/40:00:27:b7:13/40:00:10:00:00/ef Emask 0x9 (media error)  
  24. ata1.00: status: { DRDY ERR }  
  25. ata1.00: error: { UNC }  
  26. ata1.00: configured for UDMA/133  
  27. sd 0:0:0:0: [sda] Unhandled sense code  
  28. sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE  
  29. sd 0:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor]  
  30. Descriptor sense data with sense descriptors (in hex):  
  31.         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00  
  32.         0f 13 b7 27  
  33. sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed  
  34. sd 0:0:0:0: [sda] CDB: Read(10): 28 00 0f 13 b7 20 00 00 08 00  
  35. end_request: I/O error, dev sda, sector 252950311  
  36. ata1: EH complete  
  37. ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0  
  38. ata1.00: BMDMA stat 0x24  
  39. ata1.00: failed command: READ DMA  
  40. ata1.00: cmd c8/00:08:20:b7:13/00:00:00:00:00/ef tag 0 dma 4096 in  
  41.          res 51/40:00:27:b7:13/40:00:10:00:00/ef Emask 0x9 (media error)  
  42. ata1.00: status: { DRDY ERR }  
  43. ata1.00: error: { UNC }  
  44. ata1.00: configured for UDMA/133  
  45. ata1: EH complete  
  46. ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0  
  47. ata1.00: BMDMA stat 0x24  
  48. ata1.00: failed command: READ DMA  
  49. ata1.00: cmd c8/00:08:20:b7:13/00:00:00:00:00/ef tag 0 dma 4096 in  
  50.          res 51/40:00:27:b7:13/40:00:10:00:00/ef Emask 0x9 (media error)  
  51. ata1.00: status: { DRDY ERR }  
  52. ata1.00: error: { UNC }  
  53. ata1.00: configured for UDMA/133  
  54. ata1: EH complete  
最后说的是如果按ctrl+d,系统会重启(上面的错误中没有记录),如果输入root的密码,可以进入shell命令行。

我按照提示输入了root密码,进入shell后,使用df命令查看,发现到/var的时候,提示“No such file or directory”,然后我 ls /var ,发现里面空空如也,文件都不见了。但是发现df命令的“Size  Used Avail Use%”这几个值都挺正常的,从而判断并不是文件丢失,文件很可能是在某个地方,没有挂载到/var中而已。于是放入Centos安装光盘,重启,进入rescure模式:

之后分别输入:

lvm vgscan

lvm vgchange -ay

lvm lvs

最后使用e2fsck命令修复一下LVM磁盘:

e2fsck -f -y /dev/mapper/VolGroup00-LogVol00

结果会告诉你修复了哪些东西,最后将光盘取出重启系统,一切都变正常了。

注意:如果不在rescure模式,运行lvm那三条命令,可能会出现“file-based locking initialization failed”错误。强制e2fsck可能会损坏分区数据,所以操作一定要在rescure模式下进行,切记。。

猜你喜欢

转载自blog.csdn.net/taiyang1987912/article/details/80059908