LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-11-2006, 03:55 PM   #1
Temujin_12
Member
 
Registered: Sep 2003
Location: Washington
Distribution: Kubuntu Dapper
Posts: 99

Rep: Reputation: 15
Missing primary node on ext2


I'm running Kubuntu 5.10. I ran
Code:
sudo apt-get upgrade
and it downloaded and extracted the packages correctly. Then, about half way through configuring the packages it started giving me strange file missing/invalid type errors (sorry, I didn't write them down).

I restart the system (maybe not the best thing to do) and the boot process went into a check disk. After sitting there for a long time it dumped a whole bunch of errors about how there were corrupt nodes (again, I apologize for not writing them down) and recommended that I run fsck. I ran it (again, maybe not the best thing to do) and it errored out saying it couldn't find the primary node (or that it was corrupted).

Now when I restart, GRUB just gives me error 17.

Loading a live-CD, it is able to see it in /dev as hda. I cannot mount it (it says that it is not a valid ext2 partition). When I grep /dev/hda, I can tell that my files are still there.

Not knowing what to do in Linux from there, I took the drive out, put it in a USB 2.0 HD external encasing, and had Stellar Phoenix scan it. It was able to find the primary node (or at least a backup of it) and, after scanning through every block on the disk, was able to see my files and folders. It being a demo version, I have to purchase the full version to recover the files (which just may be worth it).

However, before I purchase it, I am wondering if anyone knows how to recover from a missing/corrupt primary node on ext2 or if there is a utility that can do the same thing as Stellar Phoenix.

Thanks!
 
Old 05-12-2006, 02:58 PM   #2
Temujin_12
Member
 
Registered: Sep 2003
Location: Washington
Distribution: Kubuntu Dapper
Posts: 99

Original Poster
Rep: Reputation: 15
Does anyone know what I can do in this situation? I'm dead in the water until I either buy Stellar Phoenix or find a way to do it myself.
 
Old 05-12-2006, 06:01 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,229

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
No good spending money - open systems we're talking here remember.
Stick a liveCD in - even the Gentoo minimal will do. Run "mke2fs -n /dev/hda?" (give the appropriate partition number). This will tell you where the backup superblocks are. Then try "fsck.ext2 -b ?????" using one of the backup superblocks - probably 8193 or 16384.

See how that goes.
 
Old 05-13-2006, 01:08 PM   #4
Temujin_12
Member
 
Registered: Sep 2003
Location: Washington
Distribution: Kubuntu Dapper
Posts: 99

Original Poster
Rep: Reputation: 15
Ok, I've booted off of sysresccd and ran:
Code:
ls /dev | grep hda
and I get:
Code:
hda hda1 hda2 hda5
When I run:
Code:
mke2fs -n /dev/hda
I get a warning stating that /dev/hda is an entire device, not just one partition. I chose not to proceed with that.

When I run
Code:
mke2fs -n /dev/hda1
I get the following:
Code:
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
14843904 inodes, 29662006 blocks
1483100 blocks (5.00%) reserved for the super user
First data block=0
906 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stord on blocks:  32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872
When I run
Code:
mke2fs -n /dev/hda2
I get the following message:
Code:
/dev/hda2: Invalid argument passed to ext2 library while setting up superblock
When I run
Code:
mke2fs -n /dev/hda5
I get the following:
Code:
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
17600 inodes, 351414 blocks
17570 blocks (5.00%) reserved for the super user
First data block=0
11 block groups
32768 blocks per group, 32768 fragments per group
16000 inodes per group
Superblock backups stord on blocks:  32768, 98304, 163840, 229376, 294912
Here are my questions before I proceed with the fsck.ext2 command.

Should I run 'mke2fs -n /dev/hda' on the entire device?
If not, should I run the fsck.ext2 command on /dev/hda5 or /dev/hda2?
Should I worry about the message I got from '/mke2f -n /dev/hda1'?
Does it matter which backup I choose for the fsck.ext2 command?

I hope this gives you enough information to assist me. I just want to be absolutely sure about what I am doing so I don't lose my data on that drive.

Thanks!!
 
Old 05-13-2006, 07:17 PM   #5
Temujin_12
Member
 
Registered: Sep 2003
Location: Washington
Distribution: Kubuntu Dapper
Posts: 99

Original Poster
Rep: Reputation: 15
Almost there...

I'm really close to getting this resolved. I just want to make sure I am proceeding with caution.

I noticed after running mke2fs on the different hda# that hda5 is smaller (has fewer blocks) than hda1. What is hda1? Is it my swap parition? Is it where my linux kernel image is? If so, then should I just run fsck.ext2 on hda5 to see if that clears up the error 17 that grub is giving me?

Anyways, I'm close to solving this and getting my server back online. If I could just get some answers to these questions and the qustions at the end of my previous post I think I can take it from there.

Thanks again!
 
Old 05-14-2006, 05:05 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,229

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
As I said above, mke2fs (any filesystem actually) operates at the partition level. Not the device level.
I presumed you knew how your system was configured - what partitions were what, and what fs. mke2fs is specifically for ext2 (and 3, which is just ext2 plus journalling). *only* use it on an ext2 partition.
From the systemrescueCD, try "cfdisk /dev/hda" - that'll tell you what the partition table thinks the partitions are. Good indicator, but not infallible. Pick a likely one, and try it.
As for the backup superblock to use, I always start at the first one, and use later ones if recovery fails. If you get to say number 3 or 4 in the list, the partition is probably unrecoverable.
 
Old 05-14-2006, 10:25 PM   #7
Temujin_12
Member
 
Registered: Sep 2003
Location: Washington
Distribution: Kubuntu Dapper
Posts: 99

Original Poster
Rep: Reputation: 15
Good News... And Bad News...

I have good news and bad news.

The bad news is that it wasn't able to restore my directory structure so I'll have to reinstall (no problem). It just dumped any semblance of directories and files into a lost and found directory with their respective block numbers.

The good news is that I can mount the drive, search through the disorganized lost and found directory, and find my files!!!

I'm in the process of copying my 27GB+ worth of mp3 files over to another computer (makes me wish I had a GBit network setup here).

The mp3's are mostly what I cared about since it would take me probably 12+ hours to re-rip all my CD's again.


Now that it looks like I'm past to worst so far, any suggestions as to what file system is most resilient against situations like this? Ext3, XFS, Reiser, etc?
 
Old 05-14-2006, 11:31 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,229

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
Any of the journalled should do - I don't trust Reiser, but that's largely historical.
I use ext2 for /boot as it is rarely updated, journalled for everything else.

Only times I've ever been in strife was hardware errors.

Did I mention backups ???.
 
Old 05-15-2006, 08:13 AM   #9
Temujin_12
Member
 
Registered: Sep 2003
Location: Washington
Distribution: Kubuntu Dapper
Posts: 99

Original Poster
Rep: Reputation: 15
Thanks a ton syg00. You saved me a ton of time. I'm close to having all of my data backed up. I also realized that there were a lot of other important data besides mp3's on there (ie: musical compositions, family photos, and journals). It's nice to have those back.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ieee1394: /dev/raw1394 device node missing kevinatkins Linux - Hardware 4 12-16-2008 11:07 AM
"the device node /dev/hda6 for the root filsystem is missing" after a sudden halt braungiobi Linux - General 0 05-09-2006 02:53 PM
primary partition missing renjith.hcl Linux - Hardware 1 03-22-2006 08:17 PM
Floppy device node missing. jcormacey Red Hat 2 01-25-2006 05:05 AM
boot loader, MBR, redhat9 on primary slave, winxp on primary master samik Linux - Hardware 4 10-15-2003 08:55 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration