LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-21-2004, 04:58 PM   #1
poiuytrewq
Member
 
Registered: Jul 2004
Posts: 107

Rep: Reputation: 15
trying to fix a bad partition table


I had noticed a while ago that there was something screwy with my partition table. but my computer was still booting fine. i finally got around to trying to fix it last night. i was just trying out different tools (gpart, testdisk, etc) but i did not think i had commited any changes. at any rate i wake up thismorning, turn on the computer, bios comes up, then i get nothing but a blinking cursor (text cursor, not mouse cursor).

time for the knoppix cd,
in knoppix, i run testdisk and get

Code:
TestDisk 4.0, Data Recovery Utility, April 3 2002
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/hda - CHS 2432 255 63 - 19077 MB
Check current partition structure

 1 P hid. FAT32               2   1  1   573 254 63    9189117 [HARDDRIVE]
 2 E extended LBA          1090   0  1  2431 254 63   21559230
 3 P Linux ext2fs           574   0  1  1089 254 63    8289540 [/]
 4 * Linux ext2fs             0   1  1     4  21 13      65533
Bad sector count.


  Quit
*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
                               Quit this section
so then i press enter and it goes to the next screen where it guesses a partition table
Code:
TestDisk 4.0, Data Recovery Utility, April 3 2002
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/hda - CHS 2432 255 63 - 19077 MB
Use arrow keys to change partition characteristics (see below)
Press the ENTER key to continue
    Partition                 Start          End       Size
D Linux ext2fs             0   1  1     1 254 63      32067 [/boot]
D FAT32                    2   1  1   573 254 63    9189117 [HARDDRIVE]
D Linux ext2fs           574   0  1  1089 254 63    8289540 [/]
D Linux Swap            1090   0  1  1125 254 63     578340
D FAT32                 1126   1  1  2431 254 63   20980827 [HARDDRIVE 2]



Structure: Ok  Press 'T' key to change partition type, 'P' to list files
*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
EXT3 Sparse superblock Recover
s
so i know from (my brain) memory that the structure of my harddrive is this:
Code:
in order of physically appearing first:
1)  hda4 (15Mb of ext3) [ /boot ]
2)  hda1 (4.4Gb of vfat) [ windows partiton ]
3)  hda3 ( 3.9Gb of ext3) [ / (Fedora core 1)]
4)  ----->Extended hda2
5)            hda5 (282-some-odd-Mb) [ linux swap ]
6)            hda6 (10Gb of vfat) [ my drive of random data ]
so i can change them so that (*=Primary bootable P=Primary L=Logical E=Extended D=Deleted)
/boot is *
HARDDRIVE is P
/ is P
and HARDRIVE 2 is L

but for swap i can only choose between *, P and D even though it is L

i was going to delete windows soon anyways so i have the option of using this partition table i created which the program says is ok but it is different from my original table:
Code:
Disk /dev/hda - CHS 2432 255 63 - 19077 MB

     Partition                   Start          End       Size
 1 * Linux ext2fs             0   1  1     1 254 63      32067 [/boot]
 2 P Linux ext2fs           574   0  1  1089 254 63    8289540 [/]
 3 P Linux Swap            1090   0  1  1125 254 63     578340
 4 E extended LBA          1126   0  1  2431 254 63   20980890
 5 L FAT32                 1126   1  1  2431 254 63   20980827 [HARDDRIVE 2]
is that bad or ok to do that?

edits: spellchecking gramar etc

Last edited by poiuytrewq; 11-21-2004 at 05:02 PM.
 
Old 11-22-2004, 12:07 PM   #2
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
I haven't used testdisk yet, so I can't help you with it.
But if nothing else helps, you can still edit the partition table manually. Here are some links that show the details of a partition table:
http://www.datarescue.com/laboratory/partition.htm
http://www.ata-atapi.com/hiwtab.htm

This can become very complicated (especially with more than one logical partition), you need good planning, backups of the disk areas you modify but it works (I did it myself and it worked ).
 
  


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
Bad Partition Table - Fedora Core 2 Remedy Linux - Hardware 2 05-04-2005 11:31 AM
Bad Partition Table? tommcfarlin4 Linux - Software 2 08-21-2004 12:03 PM
Fixing a bad partition table pen^2 Linux - General 2 07-21-2004 07:25 AM
how do i fix a bad partition table? rj1 Linux - General 2 02-18-2004 09:04 AM
bad partition table thetruevoice Linux - Software 2 08-23-2001 05:34 AM


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