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

/ Linux / 没有评论 / 2773浏览

具体错误如下:

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0  
ata1.00: BMDMA stat 0x24  
ata1.00: failed command: READ DMA  
ata1.00: cmd c8/00:08:20:b7:13/00:00:00:00:00/ef tag 0 dma 4096 in  
         res 51/40:00:27:b7:13/40:00:10:00:00/ef Emask 0x9 (media error)  
ata1.00: status: { DRDY ERR }  
ata1.00: error: { UNC }  
ata1.00: configured for UDMA/133  
ata1: EH complete  
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0  
ata1.00: BMDMA stat 0x24  
ata1.00: failed command: READ DMA  
ata1.00: cmd c8/00:08:20:b7:13/00:00:00:00:00/ef tag 0 dma 4096 in  
         res 51/40:00:27:b7:13/40:00:10:00:00/ef Emask 0x9 (media error)  
ata1.00: status: { DRDY ERR }  
ata1.00: error: { UNC }  
ata1.00: configured for UDMA/133  
ata1: EH complete  
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0  
ata1.00: BMDMA stat 0x24  
ata1.00: failed command: READ DMA  
ata1.00: cmd c8/00:08:20:b7:13/00:00:00:00:00/ef tag 0 dma 4096 in  
         res 51/40:00:27:b7:13/40:00:10:00:00/ef Emask 0x9 (media error)  
ata1.00: status: { DRDY ERR }  
ata1.00: error: { UNC }  
ata1.00: configured for UDMA/133  
sd 0:0:0:0: [sda] Unhandled sense code  
sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE  
sd 0:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor]  
Descriptor sense data with sense descriptors (in hex):  
        72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00  
        0f 13 b7 27  
sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed  
sd 0:0:0:0: [sda] CDB: Read(10): 28 00 0f 13 b7 20 00 00 08 00  
end_request: I/O error, dev sda, sector 252950311  
ata1: EH complete  
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0  
ata1.00: BMDMA stat 0x24  
ata1.00: failed command: READ DMA  
ata1.00: cmd c8/00:08:20:b7:13/00:00:00:00:00/ef tag 0 dma 4096 in  
         res 51/40:00:27:b7:13/40:00:10:00:00/ef Emask 0x9 (media error)  
ata1.00: status: { DRDY ERR }  
ata1.00: error: { UNC }  
ata1.00: configured for UDMA/133  
ata1: EH complete  
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0  
ata1.00: BMDMA stat 0x24  
ata1.00: failed command: READ DMA  
ata1.00: cmd c8/00:08:20:b7:13/00:00:00:00:00/ef tag 0 dma 4096 in  
         res 51/40:00:27:b7:13/40:00:10:00:00/ef Emask 0x9 (media error)  
ata1.00: status: { DRDY ERR }  
ata1.00: error: { UNC }  
ata1.00: configured for UDMA/133  
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模式下进行,切记。。