LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   file system (superblock) corrupted? (https://www.linuxquestions.org/questions/linux-newbie-8/file-system-superblock-corrupted-648174/)

ubyt3m3 06-09-2008 09:10 PM

file system (superblock) corrupted?
 
Hi,

I saw a strange thing in my /home directory. When I did #ls -l mp3, it returned many ?s in the places for the file permissions, owners, size, and date. so, all directories looked something like this:

d?????? ? ???? ???? ??? ???????????? jazz
d?????? ? ???? ???? ??? ???????????? pops
...

I thought my filesystem was corrupted, so I unmounted the /home directory and tried to run fsck on /dev/hdb2. Then it returned this message:

[snip]---
bash-3.1# fsck /dev/hdb2
fsck 1.40.8 (13-Mar-2008)
e2fsck 1.40.8 (13-Mar-2008)
/sbin/e2fsck: Filesystem revision too high while trying to open /dev/hdb2
The filesystem revision is apparently too high for this version of e2fsck.
(Or the filesystem superblock is corrupt)

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
---[snip]

I did mke2fs to look for alternative superblock and ran:

#e2fsck -f -b 98304 /dev/hdb2

Then it returned this message:

[snip]---
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/hdb2
Filesystem mounted or opened exclusively by another program?
---[snip]

How come? I did umount on /home and /dev/hdb2 and nothing should be accessing the filesystem. fuser doesn't return anything either.

Could you help me to run fsck on /dev/hdb2 at least so that I can go forward investigating the problem? /dev/hdb2 should be ext3 as described in /etc/fstab

/dev/hdb2 /home ext3 defaults 1 2

Thanks in advance,
gibb

jailbait 06-09-2008 09:40 PM

Quote:

Originally Posted by ubyt3m3 (Post 3179908)

Could you help me to run fsck on /dev/hdb2 at least so that I can go forward investigating the problem? /dev/hdb2 should be ext3 as described in /etc/fstab

/dev/hdb2 /home ext3 defaults 1 2

/dev/hdb2 is ext3 and you have been running e2fsck. It is possible that you made things worse. You also said that you ran mke2fs. If so then you wiped out the file system.

The first thing to do is run:

fsck -y -t ext3 /dev/hdb2

against a umounted /dev/hdb2. If you need to try a superblock other than the first then try:

fsck -b 32768 -y -t ext3 /dev/hdb2

------------------
Steve Stites

ubyt3m3 06-09-2008 09:48 PM

Thank you for your reply jailbait.
At first, I ran fsck.ext3 and I got the same message as I ran fsck /dev/hdb2, suggesting me to try with e2fsck -b 8193 <device>.

After reading your post, I ran the commands with -t ext3 option but I got the same result. Does this mean it's really messed up and not recovable?

I don't know why it keeps telling me that /dev/hdb2 is busy. I executed the cmd in single-user mode and no luck.

Any idea?

Thanks in advance,
gibb

onebuck 06-09-2008 10:16 PM

Hi,

You did boot into single? You could use your Slackware 12.1 install cd/dvd to insure that there won't be conflicts.

Code:

excerpt from 'man e2fsck';

 e2fsck  is  used to check a Linux second extended file system (ext2fs).
      E2fsck also supports ext2 filesystems containing a journal,  which  are
      also sometimes known as ext3 filesystems, by first applying the journal
      to the filesystem before  continuing  with  normal  e2fsck  processing.
      After  the  journal  has  been  applied,  a filesystem will normally be
      marked as clean.  Hence, for ext3 filesystems, e2fsck will normally run
      the  journal  and  exit,  unless  its superblock indicates that further
      checking is required.

      device is  the  device  file  where  the  filesystem  is  stored  (e.g.
      /dev/hdc1).

      Note  that  in general it is not safe to run e2fsck on mounted filesys-
      tems.  The only exception is if the -n option is specified, and -c, -l,
      or  -L  options  are not specified.  However, even if it is safe to do
      so, the results printed by e2fsck are not valid if  the  filesystem  is
      mounted.    If e2fsck asks whether or not you should check a filesystem
      which is mounted, the only correct answer is ``no''.  Only experts  who
      really know what they are doing should consider answering this question
      in any other way.

As for the recovery of '/home', you could try 'test-disk'.

ubyt3m3 06-09-2008 11:00 PM

Hi onebuck,

I booted up with the slackware installation cd and ran #fsck -f -t ext3 /dev/hdb2.

#fsck -f -t ext3 /dev/hdb2
fsck 1.40.8 (13-Mar-2008)
fsck: fsck.ext4: not found
fsck: Error 2 while executing fsck.ext4 for /dev/hdb2

hmm... it's recognizing the filesystem as ext4 while the /etc/fstab says ext3. Is this because /dev/hdb2 is about 150GB in size?

I'm more interested in fixing/recovering this un-mountable filesystem than inn recovering the data in it. I just don't understand why the system keeps telling me the filesystem is busy while it is unmounted and no services should be accessing it. Or is there any way to find out?

I can just format/recreate the partition and get going but I really would like to know how to fix this type of problem.

Any suggestion is welcome.

Thanks in advance,
gibb

onebuck 06-09-2008 11:10 PM

Hi,

Once you boot the install cd/dvd. Do the 'e2fsck -b 8192 /dev/your_device'. What happens?

ubyt3m3 06-10-2008 12:18 AM

Hi,

I executed the command after booting up with the installation cd and got the same result:

e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/hdb2
Filesystem mounted or opened exclusively by another program?

hmm... why???

thanks in advance,
gibb

syg00 06-10-2008 12:40 AM

From the CD, what do these produce ???
Code:

fdisk -l
file -sL /dev/hdb2

(might need root)

ubyt3m3 06-10-2008 02:31 AM

Hi,

Code:

bash-3.1# fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4b3f4b3e

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1              1        2491    20008926  83  Linux
/dev/hda2            2492        2741    2008125  82  Linux swap
/dev/hda3            2742        6477    30009420  83  Linux
/dev/hda4            6478        9729    26121690    5  Extended
/dev/hda5            6478        9729    26121658+  83  Linux

Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xfc6e07b9

  Device Boot      Start        End      Blocks  Id  System
/dev/hdb1              1        125    1004031  82  Linux swap
/dev/hdb2            126      19457  155284290  83  Linux
bash-3.1#

I booted up with the cd, mounted /dev/hda1 to /a, and ran the file command, but there was an error about libmagic.so.1 not being found. Am I doing something wrong?

so here is the output from the konsole:

Code:

bash-3.1# file -sL /dev/hdb2
/dev/hdb2: Linux rev 16777473.256 ext3 filesystem data (needs journal recovery) (errors) (large files)
bash-3.1#

Would this help?

Thanks in advance,
gibb

ubyt3m3 06-10-2008 10:52 PM

uhmm... after rebooting the system, I lost the partition table for /dev/hdb. fdisk -l tells me "Disk /dev/hdb doesn't contain a valid partiton table." I think this drive is pretty messed up.

I'm going to rebuild this derive and start over. Thank you all for your help!

gibb


All times are GMT -5. The time now is 08:35 PM.