LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-27-2008, 06:20 PM   #1
djbob
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Rep: Reputation: 0
need to SEARCH a CYLINDER for a SUPERBLOCK


Hello all,

Please see fourth post for relevant details at this point.

I am running CentOS 5.2 x64_86. All relevant partitions are ext3.

I was running out of space on my /dev/sda8 partition, so I planned on taking some space from /dev/sda7 and giving it to /dev/sda8. I first planning on resizing sda7, then rebooting, and then resizing sda8. Here is what happened:

1) I removed the journal from /dev/sda7, turning it into ext2.
2) I resized the filesystem on /dev/sda7.
3) I used fdisk to:
___a) Remove sda7. (r...7)
___b) Remove sda8. (r...7)
___c) Recreate sda7, using the same starting cylinder but an earlier ending cylinder.
___d) Recreate sda8, using the exact same starting and ending cylinders.
___e) Write the partition table to disk.
4) I then rebooted. During startup e2fsck was run, and it spit out the following error:
Quote:
bad magic number in superblock while trying to open /dev/sda8
5) I tried to e2fsck with a good amount of possible backup superblocks. No luck.

Does anybody have any ideas as to what has happened? Any suggestions on how to fix these issues?

Thanks for all your help!
djbob

Last edited by djbob; 11-28-2008 at 02:51 PM. Reason: Title changed from "'Bad magic number on superblock' after recreating partition using fdisk" to "need to SEARCH a CYLINDER for
 
Old 11-27-2008, 07:05 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,137

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
If everything was on cylinder boundaries that should work. Probably what happened was sda7 extended into a cylinder, and sda8 started at the next sector. I see this often (you see a + in the "fdisk -l" output).
With nothing in the way, the reallocation of sda8 would start at sector zero of that cylinder.
 
Old 11-27-2008, 08:07 PM   #3
djbob
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for your help syg00

How would it be possible to fix the partition table to start at a later sector in the cylinder? What block/KB values should I try?

Current output of fdisk -l /dev/sda:
Quote:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 261 2096451 83 Linux
/dev/sda2 262 1566 10482412+ 83 Linux
/dev/sda3 1567 2871 10482412+ 83 Linux
/dev/sda4 2872 60801 465322725 5 Extended
/dev/sda5 2872 3132 2096451 82 Linux swap / Solaris
/dev/sda6 3133 3263 1052226 83 Linux
/dev/sda7 3264 50324 378017451 83 Linux
/dev/sda8 59737 60801 8554612+ 83 Linux
 
Old 11-28-2008, 02:45 PM   #4
djbob
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Let me clarify what I need to do right now:

I need to search a cylinder for a superblock. Somewhere on cylinder 59737 there is a superblock, and I need to figure out at what offset I can find that superblock.

Does anybody have any ideas as to how I could do that?

Last edited by djbob; 11-28-2008 at 02:51 PM.
 
Old 11-28-2008, 05:26 PM   #5
djbob
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Original Poster
Rep: Reputation: 0
TestDisk solved the problem for me
 
  


Reply

Tags
magic, number



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
Bad magic number in superblock, again! R00T.OSIRIS Linux - Hardware 4 10-26-2007 09:49 PM
bad magic number superblock niallmccune Linux - Newbie 7 10-25-2007 03:19 PM
"Bad magic number in superblock" for a windows partition Prio Linux - Newbie 1 12-14-2006 09:12 AM
bad magic number in superblock crazynachos Linux - Games 1 04-15-2004 01:43 PM
bad magic number in superblock crazynachos Linux - Newbie 1 04-14-2004 02:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:09 AM.

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
Open Source Consulting | Domain Registration