Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bad Superblock, ext3 fs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Tokabola
n00b
n00b


Joined: 21 Apr 2004
Posts: 69
Location: Northern Wisconsin

PostPosted: Thu Jul 08, 2004 3:38 am    Post subject: Bad Superblock, ext3 fs Reply with quote

During boot the system does a check on my hde10 (mounted at /home) and tells me to run fsck manually. When I try that I'm told the Superblock is bad or corrupted. (using Ext3 fs)

Is there any way to repair the superblock of an ext3 partition? I logged in as Root, and seem to be able to access the /home directory. I can read files in my user home directory.

While I can't be sure my hd isn't dying, I had some problems last week also, and suspect Azureus (bit torrent client/gui) may be doing something funny.

How can I back up the superblock in case this happens again (assuming I'm able to fix it this time?)

There seems to be some issues with the /var directory (hde9) also, last weeks crash involved corruption (and unreadability) of the /var/lib directory rendering the box unbootable untill I removed, then replaced the /var/lib directory (booting from the Gentoo Live CD)

Thanks for any help, I'm not even really sure what a superblock is (is this where the TOC is?)

Tommy

PS. tried searching the forum, but all my searches just return me to the search page. :(
_________________
Open Source for Open Minds
Back to top
View user's profile Send private message
yooda
n00b
n00b


Joined: 09 Dec 2003
Posts: 24
Location: Zurich, Switzerland

PostPosted: Thu Jul 08, 2004 4:41 pm    Post subject: Reply with quote

I think in the superblock there is all the information about where all the files are located on the corresponding partition. this info is saved in "inodes", one for every file, and in the inode are the adresses of all the blocks from a file.

so when the superblock is corrupt, then the system can't find out where the files are.

unfortunately, this just hapened to me with a FAT32 partition (to write data from linux and windows), hmmm, no idea how to fix that...

the partition looks like this:
Code:

/dev/hdg3            7298       24792   140528587+   c  W95 FAT32 (LBA)

I hope both win XP and linux can deal with that format...


Code:

mount /dev/hdg3
mount: /dev/hdg3: can't read superblock


I tried this:
Code:

fsck.vfat -V /dev/hdg3
dosfsck 2.10, 22 Sep 2003, FAT32, LFN
There are differences between boot sector and its backup.
Differences: (offset:original/backup)
  65:01/00
1) Copy original to backup
2) Copy backup to original
3) No action
? 2
Starting check/repair pass.
Both FATs appear to be corrupt. Giving up.


no luck so far :-(

does anybody have an idea?
Back to top
View user's profile Send private message
Tokabola
n00b
n00b


Joined: 21 Apr 2004
Posts: 69
Location: Northern Wisconsin

PostPosted: Thu Jul 08, 2004 11:06 pm    Post subject: Reply with quote

I'm still getting the error on boot, and when I run fsck, but otherwise everything works fine.
I can log in as my user and access files just fine, so the partition can't be very damaged. Forum search seems to be working again, so I'll go through the other posts. It seems someone solved a similar problem by deleting .keep files. I think these are just "empty" files placed in a directory to prevent it (the directory) from being accidently deleted.

Is there any other reason I shouldn't delete these .keep files, provided I'm carefull with the rm command in the future?

Thank's

Tommy
Back to top
View user's profile Send private message
eztiger
n00b
n00b


Joined: 22 Nov 2002
Posts: 18
Location: UK

PostPosted: Fri Jul 09, 2004 1:01 pm    Post subject: Reply with quote

Hi,

I ran into this a couple of months ago...I didn't really find a solution per se but I did manage to recover the data (bear with me).

Ok...you should *already* have backups of the superblock on your drive. When you initially formatted the drive it would have placed superblocks at certain intervals on the disk depending onthe block size you used when formatting.

have a look at e2fsck -b

This will allow you to specify the location of one of these backup superblocks and in theory e2fsck should replace the main superblock with the backup.

Running mke2fs -n should tell you where the superblock backups are located (read the man page before you do this).

That should sort you right out and you will find that you have a good dozen or so backup superblocks to try. Sadly when I attempted this it didn't fix anything, I went through all the backups to no avail (although my disk was in a worse state it wouldn't even mount, if you can still mount and access it it bodes well).

In the end I had to use debugfs to back up the data from the drive before reformatting the disk.

It sounds very much like you won't have to go that far seeing as your disk still mounts, but before you try replacing the backup superblock it would be worth making a back up of anything important.

I hope this helps, I spent a frustrating afternoon fixing all this!

Kev
Back to top
View user's profile Send private message
Tokabola
n00b
n00b


Joined: 21 Apr 2004
Posts: 69
Location: Northern Wisconsin

PostPosted: Fri Jul 09, 2004 11:55 pm    Post subject: Reply with quote

Thanks,
I'll try this tomorrow after I pick up a new batch of DVD's to make full backups. That'll be easier than peicing it together from a dozen or so CD's

Tommy
Back to top
View user's profile Send private message
danwatt
n00b
n00b


Joined: 08 Oct 2003
Posts: 64

PostPosted: Sat Jul 10, 2004 4:02 am    Post subject: Reply with quote

I had a similar problem a few months ago.

https://forums.gentoo.org/viewtopic.php?t=162298

In the end, I used dd_rescue to copy the entire partition (damaged due to disk problems) to a new disk, then I used debugfs (really cool tool) to copy important files to a network share (remember - the backup I made was still broken). Then, after deleting bad inodes (fsck would not run to completion), I managed to get the partition in working order. debugfs is a nice tool, but you have to be careful using it (by default it is set to read only)

If you need details, I can post them. I just need to find my notes....

Interesting you say you were using Azureus at the time.... I was as well when my system crashed and then had problems mounting the partition.
_________________
Two boxes and counting: personal PC, student organization server w/ full portage and distfiles mirror
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum