Partition Nightmare - Is there any way to fix this?
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.