LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-14-2014, 11:58 PM   #46
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Original Poster
Rep: Reputation: 42

well it seems to be going fine now..The only thing is that I have no idea what I did, really, I mean, I tried this before but it complained about superblock.
Code:
Inode 11064788, i_blocks is 80, should be 72.  Fix? yes

Inode 11064789, i_blocks is 72, should be 64.  Fix? yes

Inode 11064790, i_blocks is 32, should be 24.  Fix? yes

Inode 11064791, i_blocks is 32, should be 24.  Fix? yes

Inode 11588545, i_blocks is 8, should be 0.  Fix? yes

Inode 11588571, i_blocks is 24, should be 16.  Fix? yes

Inode 11588575, i_blocks is 24, should be 16.  Fix? yes

Inode 11588572, i_blocks is 16, should be 8.  Fix? yes

Inode 11588573, i_blocks is 48, should be 40.  Fix? yes

Inode 11588574, i_blocks is 32, should be 24.  Fix? yes

Inode 12014113, i_blocks is 16, should be 8.  Fix? yes

Inode 12603361, i_blocks is 16, should be 8.  Fix? yes

Inode 13454497, i_blocks is 16, should be 8.  Fix? yes

Recreate journal? yes

Creating journal (32768 blocks):  Done.

*** journal has been re-created - filesystem is now ext3 again ***
Restarting e2fsck from the beginning...
/dev/loop0 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Root inode is not a directory.  Clear? yes


Inode 7332880, i_blocks is 120, should be 104.  Fix? yes


Running additional passes to resolve blocks claimed by more than one inode...
Pass 1B: Rescanning for multiply-claimed blocks
Multiply-claimed block(s) in inode 8: 7347689 7347690 7347691 7347692 7357346 7357347 7357348 7358992 7358993 7358994 7358998 7358999 7360040
Multiply-claimed block(s) in inode 2624008: 4622379 4622380 4622381 4622382 4622383 4622384 4622444 4622445 4622446 4622447

Last edited by cbtshare; 01-15-2014 at 12:02 AM.
 
Old 01-15-2014, 02:09 PM   #47
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,512

Rep: Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541
When you tried it before, it aborted because it was not allowed ("-n" option) to clear what it saw as an invalid journal. Now, it is proceeding.

That "Root inode is not a directory" error means that everything is going to end up in lost+found. Whether that will result in some subdirectory trees there with recognizable file names, or just a bazillion anonymous files with names derived from their inode numbers remains to be seen. Just let it finish, then mount the loop device (read-only recommended) and see if the filesystem contains anything recoverable/useful. As I said, it's a stab in the dark. With luck, perhaps the LVM backup file wil be there, avoiding any need for the hexedit search.
 
Old 01-16-2014, 11:05 PM   #48
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Original Poster
Rep: Reputation: 42
Thank you for all your help in resolving my issue.This was a First for me here ..The data structure was messed up and all the parent directories were renamed to inode numbers so it was a task to find anything, but I eventually did.

Just going forward, do you have any insight as to why this happened? The DD command was correct and the img was not touched since backed up.How can I prevent this from happening in the future, and is there a tutorial or guide you could give me, to learn how you knew where ntfs sector started and how to work around the bad superblock errors I was getting before when I tried to mount.
 
Old 01-16-2014, 11:56 PM   #49
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,512

Rep: Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541
I'm very glad to hear you were able to recover at least some of your data. I have no idea why the image was so badly corrupted. Someone may chime in and say, "Oh, you shouldn't be backing up a mounted filesystem with dd", but even if that was what you did it doesn't come close to accounting for the partition table, superblocks, LVM structure, etc. that were missing from your backup. Have you ever let memtest86 run overnight on that machine? I really looks like some sort of hardware problem bit you, but there are a lot of pieces in that chain.

As for avoiding this sort of problem in the future, all that comes to mind is, "Test your backup." For a dd image you might just do an md5sum of the drive (assuming it was inactive) and checking that against the image, but if the error was in reading the source the sums might match, plus there is no way to distinguish a single bad bit from gross corruption. Mounting both the original drive and the image and doing a file-by-file comparison is the only sure way. Personally, I'd just be sure to keep the original drive around until I had successfully restored to the new one.

The calculations of where things were located is just basic CHS to LBA translation with a known geometry. The only hitch there is that you have to know that sector numbers start from 1, not 0, so the formula is just
Code:
(((cyl * heads_per_cyl) + head) * sectors_per_track) + (sector - 1)
Multiply the result by the sector size (512 in your case) to convert from LBA to byte offset.

As for cleaning up the superblock problems, that was just a matter of letting fsck do its thing and paying attention to the messages. In that last case, it was apparent that fsck was giving up when it was told not to clear the bad journal, and the solution to that was obvious. Remember, though, that using the "-y" option with fsck is basically applying a BFH (Big F... Hammer) to beat the filesystem back into shape, often at the expense of some of the file content, and doing that prematurely can cause a lot more damage than it fixes.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I SSH into an Encrypted partition? I have backed up all of my files on it theif519 Linux - Newbie 3 07-05-2011 10:15 AM
fresh 9.10 install reboot error no device trying to mount partition mount: can't fin bud1237 Ubuntu 1 06-24-2010 12:44 AM
how mount mount ntfs partition of windows xp kashif2131971 Linux - Newbie 3 07-07-2009 06:34 PM
Fedora 11: Cannot mount partition on Seagate FreeAgent Drive's secondary partition Erik Anderson Linux - Newbie 5 06-25-2009 01:10 AM
This is how I backed up my root partition cragwolf Slackware 3 09-14-2004 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration