LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 02-04-2005, 09:36 AM   #1
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Really messed up my partition table


I think I really screwed the pooch this time. I wanted to get rid of Windows on my Slackware box, so I erased the partition Now, I can't do anything with the 30GB that was there. Maybe I should just show what is happening:
Code:
[root@slackdell /home/scuzzy]$ fdisk -l

Disk /dev/hda: 40.0 GB, 40000000000 bytes
16 heads, 63 sectors/track, 77504 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1       58251    29358472+  83  Linux
/dev/hda2           58252       76979     9438187+  83  Linux
/dev/hda3           76979       77505      265072+  82  Linux swap
[root@slackdell /home/scuzzy]$ lilo
Fatal: First sector of /dev/hda1 doesn't have a valid boot signature
[root@slackdell /home/scuzzy]$ fsck /dev/hda1
fsck 1.35 (28-Feb-2004)
e2fsck 1.35 (28-Feb-2004)
Couldn't find ext2 superblock, trying backup blocks...
/sbin/e2fsck: Bad magic number in super-block while trying to open /dev/hda1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

[root@slackdell /home/scuzzy]$
I've tried deleting/recreating the drive using fdisk. cfdisk simply craches with this message when I try to run it:
Code:
FATAL ERROR: Bad primary partition 2: Partition ends in the final partial cylinder
                          Press any key to exit cfdisk
and when I try to write a partition to it using parted or mkfs, the programs just crash with no error messages...
What's odd, is through all this partitioning, lilo still works (I wanted to reinstall it after removing the Windows option) so I know the MBR (somehow) survived...
Also, just in case it should help, here's this:
Code:
[root@slackdell /home/scuzzy]$ cat /etc/fstab
/dev/hda3        swap             swap        defaults         0   0
/dev/hda2        /                ext3        defaults         1   1
#/dev/hda1        /disk1           ext3        defaults         1   1
/dev/cdrom       /mnt/cdrom       iso9660     noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
[root@slackdell /home/scuzzy]$
The /dev/hda1 is commented out because I don't want to mount it while it's still screwed.

Any ideas?
 
Old 02-04-2005, 11:18 AM   #2
Lazarus
Member
 
Registered: Dec 2001
Location: Kent in UK
Distribution: Fedora 2
Posts: 170

Rep: Reputation: 30
It may be a silly question but when you created the partition did you then create a file system on it eg

mke2fs /dev/hda1

or

mkreiserfs /dev/hda1

must be done before the partition is used. NB any data in there will be distroyed!
 
Old 02-04-2005, 11:59 AM   #3
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
I think a lot of your errors are due to hda2 and hda3 overlapping. You may want to look into that as well. If you have filesystems on all partitions, you could be in for a bit of a headache.
 
Old 02-04-2005, 12:07 PM   #4
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
I think the problem is the overlap between hda2 and hda3. They should not used the same cylinder as start and stop. How did that happen? If you deleted hda1, that means it has like this before? Maybe you could resize one of these partitions.
 
Old 02-04-2005, 12:28 PM   #5
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Original Poster
Rep: Reputation: 47
The install overlapped the 2 partitions... They've been like that the entire time... I'll look into resizing them properly though...
 
Old 02-04-2005, 12:42 PM   #6
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Original Poster
Rep: Reputation: 47
Quote:
Originally posted by Lazarus
It may be a silly question but when you created the partition did you then create a file system on it eg

mke2fs /dev/hda1

or

mkreiserfs /dev/hda1

must be done before the partition is used. NB any data in there will be distroyed!
Well, this looked like it had gone through...
But, when I tried reinstalling LILO to it, this happened:
Code:
[root@slackdell /home/scuzzy]$ lilo
Fatal: First sector of /dev/hda1 doesn't have a valid boot signature
[root@slackdell /home/scuzzy]$
Also - generating the same errors when running cfdisk, but passing fine when I run fsck:
Code:
[root@slackdell /]$ fsck /dev/hda1
fsck 1.35 (28-Feb-2004)
e2fsck 1.35 (28-Feb-2004)
/dev/hda1: clean, 11/3670016 files, 115174/7339618 blocks
[root@slackdell /]$
<EDIT>
Now: I think the cfdisk problem may be with the partitions overlapping - I'll shrink my swap down a little (my version of parted can't handle ext3 for some reason)

OK - Done:
Code:
[root@slackdell /]$ fdisk -l

Disk /dev/hda: 40.0 GB, 40000000000 bytes
16 heads, 63 sectors/track, 77504 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1       58251    29358472+  83  Linux
/dev/hda2           58252       76979     9438187+  83  Linux
/dev/hda3           76980       77504      264600   82  Linux swap
[root@slackdell /]$
That fixed the cfdisk problem </EDIT>
But what's up with LILO it still won't install...

Last edited by scuzzman; 02-04-2005 at 12:48 PM.
 
Old 02-04-2005, 12:52 PM   #7
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
Why are you trying to write lilo on hda1? Your root filesystem (/) is on hda2 and lilo is still located in the MBR of hda (you said it's working, didn't you?). So what is the problem?
 
Old 02-04-2005, 01:17 PM   #8
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Original Poster
Rep: Reputation: 47
Never mind.. I had to use this:
Code:
lilo -A /dev/hda
This initialized the HDD for another MBR
Then, I could install LILO on /dev/hda1 with the lilo command

Just for the googler's - I did this through an Ubuntu live CD by mounting then chrooting to access my slackware partition(s).

I am now proud to say: I'm Windows FREE!

Thanks for all your guys' help

Last edited by scuzzman; 02-04-2005 at 01:36 PM.
 
  


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
Messed up partition table. randrake Linux - General 3 12-15-2005 02:50 PM
Messed up partition table, DOH javamdk Slackware 2 03-17-2005 08:14 PM
Restoring working but messed up partition table mjs2020 Linux - Hardware 1 12-06-2004 07:19 PM
Arrg... Messed up Grub and partition table... raid517 Linux - Software 1 10-09-2003 07:18 PM
HELP machine won't boot (partition table messed up???) nfisk Linux - General 7 02-02-2003 06:12 AM


All times are GMT -5. The time now is 04:41 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