3

Last night my server encounter "Read-only file system" error.

So then I ran "fsck -Af -M" to trying to repair but no use, these are output:

fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/: recovering journal
fsck.ext3: Bad magic number in super-block while trying to re-open /
e2fsck: io manager magic bad!

After I reboot the server, I can't even recover the filesystem anymore and must reinstall the OS. My / was RAID 1 and ext3 formated. Did that fsck command cause my filesystem corrupted? or it has been corrupted before I run fsck?

Thanks :)

foo
  • 33
  • 4

1 Answers1

2

First, I would try using a backup super-block, but you'll need to know the filesystem's blocksize.

From the e2fsck man page:

The location of the backup superblock is dependent on the filesystem’s blocksize. For filesystems with 1k blocksizes, a backup superblock can be found at block 8193; for filesystems with 2k block-sizes, at block 16384; and for 4k blocksizes, at block 32768.

As an example, this command is for a 1K blocksize filesystem:

fsck.ext3 -b 8193 /dev/sda2

Good luck!

skohrs
  • 1,510
  • 11
  • 23
  • But I want to know for sure if running "fsck -Af -M" cause my filesystem corrupted or others reason. I want to prevent this issue in the future :) – foo Dec 16 '13 at 14:44
  • Probably not, because you used the `-M` option. This would've prevented it from scanning the mounted filesystem. – skohrs Dec 16 '13 at 15:25
  • thanks for your reply, now I must find the real root cause that corrupted my file system. – foo Dec 16 '13 at 17:19