recovering an filesystem corruption - Linux

Lucy avatar
By Lucy
at 2015-01-23T20:46

Table of Contents

Sorry for using english, I'm running on a old liveCD.

When I boot my system (Ubuntu 12.04) half an hour ago, it crashed.
Only black screen with mouse pointer show up after login into lightdm.

I rebooted, get dropped into initramfs prompt. The disk keep spining up and down.
Tried mounting the filesystem, but in vain.

Now I booted from liveCD,
# dd if=rootdev bs=4k skip=1 count=1
and got:
00000000 ff a1 00 00 10 00 00 00 c0 aa bc 54 16 93 06 00 |...........T....|
00000010 0f c2 06 00 00 00 00 00 00 00 01 00 00 00 00 00 |................|
00000020 00 00 00 00 01 00 00 00 2f 75 73 72 2f 62 69 6e |......../usr/bin|
00000030 2f 6d 6c 6f 63 61 74 65 00 00 02 00 00 00 00 00 |/mlocate........|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000060 00 00 00 00 b4 d8 dd c6 00 00 00 00 00 00 00 00 |................|
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000080 1c 00 00 00 e0 e2 7e 84 e0 e2 7e 84 30 0d 4d 78 |......~...~.0.Mx|
00000090 67 2d 4b 51 e0 e2 7e 84 00 00 00 00 00 00 00 00 |g-KQ..~.........|
000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000100 ff a1 00 00 20 00 00 00 e7 0b bb 54 67 2d 4b 51 |.... ......Tg-KQ|
00000110 67 2d 4b 51 00 00 00 00 00 00 01 00 00 00 00 00 |g-KQ............|
00000120 00 00 00 00 01 00 00 00 2f 75 73 72 2f 73 68 61 |......../usr/sha|
00000130 72 65 2f 6d 61 6e 2f 6d 61 6e 31 2f 6d 6c 6f 63 |re/man/man1/mloc|
00000140 61 74 65 2e 31 2e 67 7a 00 00 00 00 00 00 00 00 |ate.1.gz........|
00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000160 00 00 00 00 b5 d8 dd c6 00 00 00 00 00 00 00 00 |................|
00000170 00 00 00 00 00 00 00 00 f1 99 77 06 00 00 00 00 |..........w.....|
00000180 1c 00 00 00 e0 e2 7e 84 e0 e2 7e 84 6c f5 69 4e |......~...~.l.iN|
00000190 67 2d 4b 51 ea e2 7e 84 38 2d c2 54 08 00 00 00 |g-KQ..~.8-.T....|
000001a0 6a 88 18 00 00 00 00 00 65 78 74 34 5f 6d 61 70 |j.......ext4_map|
000001b0 5f 62 6c 6f 63 6b 73 00 00 00 00 00 00 00 00 00 |_blocks.........|
000001c0 00 00 00 00 00 00 00 00 51 02 00 00 38 2d c2 54 |........Q...8-.T|
000001d0 08 00 00 00 51 02 00 00 73 88 18 00 00 00 00 00 |....Q...s.......|
000001e0 65 78 74 34 5f 6d 61 70 5f 62 6c 6f 63 6b 73 00 |ext4_map_blocks.|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000200 ff a1 00 00 0b 00 00 00 c0 aa bc 54 67 2d 4b 51 |...........Tg-KQ|
00000210 67 2d 4b 51 00 00 00 00 00 00 01 00 00 00 00 00 |g-KQ............|
00000220 00 00 00 00 01 00 00 00 2f 62 69 6e 2f 6d 74 2d |......../bin/mt-|
00000230 67 6e 75 00 00 00 00 00 00 00 00 00 00 00 00 00 |gnu.............|

which is not at all an ext4 FS

Then I tried
# mount -t ext4 -oro,sb=163840(or 32768, etc., the common backup superblock position) /dev/sda5 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sda5
.....

smartctl -a gives some panding sectors

Then what else can I do to recover/mount my system?
And does it look like I have to replace the disk?

--
Tags: Linux

All Comments

James avatar
By James
at 2015-01-26T01:18
硬碟可能壞了 用ddrescue先把硬碟備份吧
Frederic avatar
By Frederic
at 2015-01-30T10:45
先把東西dd出來再想怎麼救 有跑過fsck?
Robert avatar
By Robert
at 2015-02-03T18:06
useful data was already backuped (not affected in other
partitions)
Caitlin avatar
By Caitlin
at 2015-02-07T08:12
fsck ended with I/O error

ppp0與eth0之橋接問題

Sierra Rose avatar
By Sierra Rose
at 2015-01-23T10:31
Hi, 各位板友前輩們好, 最近我在玩3G dongle移植到embedded Linux上, 目前已經可以正確識別3G dongle並可以成功連線, 大概想要用vlan的方式把ppp0跟eth0橋接起來, 我的指令大概是這樣: vconfig add eth0 42 ifconfig eth0.42 u ...

如何讓shellscript重開機後繼續執行

Elizabeth avatar
By Elizabeth
at 2015-01-22T14:04
如標題所示,小弟寫了一個shell script, 過程中需要reboot機器, 想請問有什麼方法能讓機器重啟後, 繼續執行shellscript尚未執行的部分, 還請版上前輩多多指教, 謝謝 - ...

VPN Server 架設問題

Madame avatar
By Madame
at 2015-01-22T10:30
※ 引述《gamed (Maiko)》之銘言: : 最近因為課業需求 : 在我自己電腦架了一台VPN : 主要想要研究 IP Security : google 有很多架設文章 : 目前可以架設出來 : client(XP) 可以連到 server(ubuntu) : 但是我想要看不同的協議的封包 : ESP ...

VPN Server 架設問題

Steve avatar
By Steve
at 2015-01-22T00:07
最近因為課業需求 在我自己電腦架了一台VPN 主要想要研究 IP Security google 有很多架設文章 目前可以架設出來 client(XP) 可以連到 server(ubuntu) 但是我想要看不同的協議的封包 ESP協議 和 AH協議 請問要改哪裡的conf 呢? 另外 我client ...

手殘lvresize root lv 比filesystem小

Joe avatar
By Joe
at 2015-01-21T23:30
請各位大大求救了 我剛剛要 lvresize root lv,是掛載我根目錄的一個lv 我只是想resize小一點,本來想打 lvresize -l -1297 lv 卻打成lvresize -l 1297 lv,lv變5G,filesystem是6G 我沒仔細看訊息,還按yes,現在目前root l ...