The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Linux HDD Recovery asturmas Filesystems, Disks and Memory 2 06-04-2009 04:22 PM
superblock error ppass Red Hat 2 01-07-2009 01:22 PM
Ask Linux.com: Theft recovery, skeleton files, and boot-looping Eees iBot UNIX and Linux RSS News 0 08-17-2008 09:10 AM
How to corrupt a superblock? sujathan SUN Solaris 2 02-29-2008 05:35 AM
Help! Boot failure - corrupt superblock alarmcall Linux 0 06-04-2004 02:22 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-28-2008
lochraven lochraven is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 29
Linux EXT3 superblock recovery

Is there a way to recover or rebuild the superblock of an ext3 filesystem with out loosing data?

Thanks
  #2 (permalink)  
Old 08-28-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
Normally, there are backup copies of the superblock distributed throughout the filesystem. You can specify this to fsck with -b. To find out the block id, read the e2fsck man page. Essentialy, you run mke2fs as you originally did on the device, but with the -n option so that nothing is written to disk.
  #3 (permalink)  
Old 08-28-2008
lochraven lochraven is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 29
I've tried that and here is what happens:

# fsck.ext3 -b 32768 /dev/sdb
Superblock has an invalid ext3 journal (inode 8).
Clear<y>?

I thought that command would update the superblock with a saved copy.

Is my interpretation of the man page correct?


If I answer 'y', then it says:
*** ext3 journal has been deleted - filesystem is now ext2 only ***

Then it continues to try and fix additional inodes.

Does this mean that the superblock / filesystem is beyond recovering?
  #4 (permalink)  
Old 08-28-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Sounds like the journal is beyond recovery, but the filesystem as such can be recovered. The journal contains stuff since the last journal sync, which is usually not a major amount of data. So there will likely be some data loss to stuff that happened just before the crash, but it might be worth doing. (Perhaps you can take a clone of the raw disk with dd so you can revert if this operation turns sour after all.)
  #5 (permalink)  
Old 08-28-2008
lochraven lochraven is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 29
I let the fsck continue, answering 'y' to everything.
When it was finished I was able to mount the filesystem as ext2 and all data was still there.
  #6 (permalink)  
Old 08-28-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
Quote:
Originally Posted by lochraven View Post
I let the fsck continue, answering 'y' to everything.
When it was finished I was able to mount the filesystem as ext2 and all data was still there.
Great! Now you want to go back and re-create the journal. Do a man on tune2fs. It helps if you have a spare partition, but it is not necessary. You want to do something like:

tune2fs -j /dev/hdc

To enable the hdc with journaling.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:58 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0