问题情况
500G机械硬盘使用过程中出现挂载失败的问题,查看是第二分区没有挂载,进行分析与排查;
查看磁盘
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 244 1959898+ 83 Linux
/dev/sdb2 245 60801 486424102+ 83 Linux
容量和分区正常;
查看挂载
/dev/sdb1 1.8G 5.6M 1.7G 0% /extroot/mini_web
/dev/sdb1 on /extroot/mini_web type ext4 (ro,nosuid,nodev,noatime,nodelalloc,journal_checksum,noauto_da_alloc,data=ordered)
第一分区挂载容量和挂载正常;
第2分区没有挂载成功,下面尝试挂载和修复;
无参挂载
~ # mount /dev/sdb2 aa
EXT4-fs (sdb2): error loading journal
EXT4-fs (sdb2): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (sdb2): couldn't mount as ext2 due to feature incompatibilities
JBD2: journal transaction 107652 on sdb2-8 is corrupt.
EXT4-fs (sdb2): error loading journal
yaffs: dev is 8388626 name is "sdb2" rw
yaffs: passed flags ""
yaffs: yaffs: Attempting MTD mount of 8.18,"sdb2"
yaffs: yaffs: MTD device 18 either not valid or unavailable
yaffs: dev is 8388626 name is "sdb2" rw
yaffs: passed flags ""
yaffs: yaffs: Attempting MTD mount of 8.18,"sdb2"
yaffs: yaffs: MTD device 18 either not valid or unavailable
ext2/3/4和yaffs2都挂载失败,第二分区是ext4文件系统,挂载失败,提示文件日志加载失败,可能是被破坏;
尝试修复
fsck.ext4 /dev/sdb2 -yf
修复时提示很多文件被破坏,在lost-found目录下很多文件,看来文件损坏很严重,查看是否硬件掉电次数为0,文件被破坏原因未知待查;
重新挂载
mount -t ext4 /dev/sdb2 aa
/dev/sdb2 462.7G 104.4G 335.1G 24% /tmp/aa
/dev/sdb2 on /tmp/aa type ext4 (rw,relatime,data=ordered)
重新挂载成功
总结
使用过程中文件被破坏,挂载失败后应该尝试进行后台修复;文件被破坏原因待查。