LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 08-31-2005, 08:57 PM   #1
integrale
LQ Newbie
 
Registered: Aug 2005
Posts: 15

Rep: Reputation: 0
Partition Nightmare - Is there any way to fix this?


I recently installed Debian on my system with the hope of dual-booting with WinXP, and now my partition table is all screwed up.

Here's the output of fdisk /dev/hda/ -l:

Code:
Disk /dev/hda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *       29551       30401     6835657+  83  Linux
/dev/hda2   *           1       22366   179648248+   7  HPFS/NTFS
/dev/hda3           23248       29550    50628847+   f  W95 Ext'd (LBA)
/dev/hda5           23248       24129     7083688+   b  W95 FAT32
/dev/hda6           24130       24359     1847443+  82  Linux swap / Solaris
/dev/hda7           24360       29550    41696676   83  Linux

Partition table entries are not in disk order
So, as you can see, my last partition is listed first, and on a previous run of fdisk, it showed that the HPFS/NTFS partition actually ended in the middle of a cylinder. There's also an overlap between hda3 and hda5...and where's hda4?? What's with the big gap between hda2 and hda3? Am I totally sunk? I've got some data I'd like back on this disk, and reinstalling everything would be (as you all know) a real b!tch.

Anyone got a favorite linux partition manager that could help?
 
Old 08-31-2005, 09:13 PM   #2
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
I don't know if it can help but I like the Mandrake partition thingo. Either boot a PCLInuxOS or MandrakeMove LiveCD or boot a Mandrake install CD up to the partitioning stage.
 
Old 09-01-2005, 12:19 AM   #3
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
There's nothing wrong with your partitions, so don't do something stupid that will screw up your disk.

The numerical order of the partitions does not need to match the physical order of the partitions on the disk. If it really bothers you, then there is an advanced feature in fdisk that can make the primary partition numbering match the physical order on the disk, but it is a really bad idea to change the numbering, unless you understand how the changes will impact the installed operating systems.

hda3 is an extended partition, which is a specialized primary partition that can be subdivided into logical partitions. All partitions numbered greater than 4 are logical partitions and should fall within the cylinder range of hda3.

The reason that there is no hda4 is because one has not been created. If you really want an hda4, then use fdisk to create it using the unused cylinders you identified.

The fdisk “error” about a partition ending in the middle of a cylinder is not a fatal problem. It can be “fixed”, but you should just leave it alone. I see this “error” periodically when using PartitionMagic to format drives. A cylinder is just a conceptual way to visualize the organization of the drive. After all, do you really think that your drive has 255 heads? That's what fdisk is telling you.
 
Old 09-01-2005, 12:45 PM   #4
integrale
LQ Newbie
 
Registered: Aug 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks for the advice, whatshisname, but this isn't just a cosmetic complaint - my system doesn't work.

I can't boot WinXP (from hda2) and none of the partition tools are able to read my partition table - other than fdisk. At this point, i can't boot anything; my system just tells me to insert bootable media because it doesn't properly recognize the hd. I also have a recovery partition on hda5 that I can't boot from or access.

I used Partition Magic to do this, and everything worked fine until I actually installed Debian and used their partitioner tool. So there is something that needs to be "fixed." I just don't know what it is or how to do it.
 
Old 09-01-2005, 02:21 PM   #5
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
It might have something to do with two partitions being marked as bootable.

Using linux fdisk, toggle off the boot flag on hda1 and try booting the system again with only hda2 marked as bootable. Two partitions marked as bootable would confuse windows.
 
Old 09-02-2005, 11:26 AM   #6
integrale
LQ Newbie
 
Registered: Aug 2005
Posts: 15

Original Poster
Rep: Reputation: 0
I think it's too late for that; I can't get anything to boot at all. I'll try to get fdisk going, but GRUB won't load, so I think I'm sunk.
 
Old 09-02-2005, 01:08 PM   #7
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
It sounds like you are having what could be a very minor problem with the MBR, but it is hard to make repair suggestions when you are not supplying information about what you have tried to do. It would be very helpful to have a look at the current partition structure on the disk using linux fdisk.

Did you try running PartitionMagic by booting with the PM CD or the emergency floppies? If you run PM in emergency mode, do NOT answer “yes” to any autorepair questions. Letting PM attempt to repair the problem will likely destroy the partition structure. Been there, done that, but even that is probably fixable using linux fdisk.

Also, there is an often suggested utility called testdisk that people in your situation rave about. For details, see: http://www.cgsecurity.org/index.html?testdisk.html

Another option is to try booting from the xp installation CD into repair mode/recovery console (at the “install/repair” question) and running the fixmbr utility. Normally, that will return you to windows-controlled booting and you can then straighten out the grub issues.
 
Old 09-02-2005, 04:52 PM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I endorse EhatsHisName's comment. 9 times out of 10 the damage is done by Partition Magic. I too never allow it to fool me again when it reports error in my disk and offer to fix it.

To me you have no problem if there isn't anything in hda1. Just use Fdisk to delete it, reboot and everything should back to normal as before.

The partition table looks healthy to me too. Hda3 is your Extended partition which is just a border for the logical partitions. hda5 to hda7 are in a consecutive order and so nothing wrong with that.

If your Extended partition is hda3 that mean you would have created two primary partitions before.

After you have deleted hda1 and reboot you should cylinder between 22367 to 23247 as unallocated primary space. If a partition is created it will be your new hda1 ready to take the new distro.
 
  


Reply



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
all attempts to fix the problem failed... can someone help me fix partition space? foreverdita Linux - Enterprise 2 05-11-2005 09:02 AM
trying to fix a bad partition table poiuytrewq Linux - Hardware 1 11-22-2004 11:07 AM
Partition corruption fix validation notb Linux - General 2 11-08-2004 09:54 AM
fstab nightmare: how to give users access to ext3 partition? ianunderwood Linux - General 5 11-21-2003 06:00 PM
How to fix a F*CKED-UP partition? Megamieuwsel Linux - General 9 09-27-2003 01:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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