天天看点

文件系统损坏解决实例

客户系统早晨突然掉电,再启动,发现没法启动应用程序,报文件系统损坏。前辈帮忙解决了,记录下来解决步骤,自己学习:

[root@erp02 ~]# mount /devdb

mount: wrong fs type, bad option, bad superblock on /dev/sdc2,

       missing codepage or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so

以上,断电使得/dev/sdc2分区出错,不能mount:

查看开机启动的信息:

[root@erp02 ~]# dmesg | tail -n 20

ADDRCONF(NETDEV_UP): eth1: link is not ready

Bluetooth: Core ver 2.10

NET: Registered protocol family 31

Bluetooth: HCI device and connection manager initialized

Bluetooth: HCI socket layer initialized

Bluetooth: L2CAP ver 2.8

Bluetooth: L2CAP socket layer initialized

Bluetooth: RFCOMM socket layer initialized

Bluetooth: RFCOMM TTY layer initialized

Bluetooth: RFCOMM ver 1.8

ext3: No journal on filesystem on sdc2

Bluetooth: HIDP (Human Interface Emulation) ver 1.1

eth0: no IPv6 routers present

hda: drive_cmd: status=0x51 { DriveReady SeekComplete Error }

hda: drive_cmd: error=0x04 { AbortedCommand }

ide: failed opcode was: 0xec

FS-Cache: Loaded

进行修复操作,先查询Superblock位置信息:

[root@erp02 ~]# dumpe2fs /dev/sdc2 | grep -i superblock

dumpe2fs 1.39 (29-May-2006)

  Primary superblock at 0, Group descriptors at 1-15

  Backup superblock at 32768, Group descriptors at 32769-32783

  Backup superblock at 98304, Group descriptors at 98305-98319

  Backup superblock at 163840, Group descriptors at 163841-163855

  Backup superblock at 229376, Group descriptors at 229377-229391

  Backup superblock at 294912, Group descriptors at 294913-294927

  Backup superblock at 819200, Group descriptors at 819201-819215

  Backup superblock at 884736, Group descriptors at 884737-884751

  Backup superblock at 1605632, Group descriptors at 1605633-1605647

  Backup superblock at 2654208, Group descriptors at 2654209-2654223

  Backup superblock at 4096000, Group descriptors at 4096001-4096015

  Backup superblock at 7962624, Group descriptors at 7962625-7962639

  Backup superblock at 11239424, Group descriptors at 11239425-11239439

  Backup superblock at 20480000, Group descriptors at 20480001-20480015

  Backup superblock at 23887872, Group descriptors at 23887873-23887887

根据查询得到的backup superblock位置号,进行修复:

[root@erp02 ~]# fsck.ext3 -y -b 98304 /dev/sdc2

e2fsck 1.39 (29-May-2006)

/dev/sdc2 was not cleanly unmounted, check forced.

Pass 1: Checking inodes, blocks, and sizes

Pass 2: Checking directory structure

Pass 3: Checking directory connectivity

Pass 3A: Optimizing directories

... ...

/dev/sdc2: ***** FILE SYSTEM WAS MODIFIED *****

/dev/sdc2: 86343/31326208 files (0.4% non-contiguous), 53066211/62647263 blocks

[root@erp02 ~]# mount /dev/sdc2

以上,发现还是不能mount。

检查:

[root@erp02 ~]# fsck.ext3 /dev/sdc2

/dev/sdc2: clean, 86343/31326208 files, 53066211/62647263 blocks

[root@erp02 ~]# umount /dev/sdc2

umount: /dev/sdc2: not mounted

检查完后变成ext2文件系统,所以不能mount为ext3文件系统。

[root@erp02 ~]# mount /dev/sdc2 /devdb

[root@erp02 ~]# mount

/dev/sdc2 on /devdb type ext2 (rw)

[root@erp02 ~]# umount /devdb

转为ext3文件系统

[root@erp02 ~]# /sbin/tune2fs -j /dev/sdc2

成功mount /devdb

启动DEV数据库和应用。

下面转载几篇重要的修复实例:

http://blog.csdn.net/cymm_liu/article/details/36185733

http://blog.csdn.net/cymm_liu/article/details/36185805

http://blog.csdn.net/cymm_liu/article/details/36185881

http://blog.csdn.net/cymm_liu/article/details/36186127

继续阅读