LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Partition Nightmare - Is there any way to fix this? (https://www.linuxquestions.org/questions/linux-general-1/partition-nightmare-is-there-any-way-to-fix-this-358996/)

integrale 08-31-2005 08:57 PM

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?

tkedwards 08-31-2005 09:13 PM

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.

WhatsHisName 09-01-2005 12:19 AM

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.

integrale 09-01-2005 12:45 PM

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.

WhatsHisName 09-01-2005 02:21 PM

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.

integrale 09-02-2005 11:26 AM

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.

WhatsHisName 09-02-2005 01:08 PM

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.

saikee 09-02-2005 04:52 PM

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.


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