LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Fixing a bad partition table (https://www.linuxquestions.org/questions/linux-general-1/fixing-a-bad-partition-table-207479/)

pen^2 07-20-2004 12:34 PM

Fixing a bad partition table
 
I had been using SuSE for a while, but recently I made the mistake of installing Fedora Core 2. Like many other people, it arsed up my partitions and I could no longer boot my Windows XP partition. I did manage to work around the problem though by entering the following command as root.

sfdisk -d /dev/hda | sfdisk --no-reread --force -H255 /dev/hda

Windows would now boot, it complained about an invalid boot.ini, but it worked.

Anyway now I am trying to install Slackware 10 and get rid of the Fedora nightmare. But when I start cfdisk I get the following error:

FATAL ERROR: Bad primary partition 2: Partition ends in the final partial cylind

Press any key to exit cfdisk

So it seems Fedora has decided to fuck me over once again. What I would like to know is, do I have any hope of fixing this without having to just wipe my entire hard drive and reformat/partition it? I really don't want to lose my windows data, or waste the time it takes to install it.

Any help would be very greatly appreciated.

RobertP 07-20-2004 01:03 PM

cfdisk is very fussy. Try fdisk, sfdisk or parted.

If you get in, try reading the partition data for that other OS, in cylinders or sectors. Record that. Clear the table. Re-enter the data for that other OS and write the new table. If you want to use cfdisk to write the new table, you can tell it not to read from the disk with
sfdisk -l
cfdisk -z Here, set up the new partition table as you like it.

pen^2 07-21-2004 06:25 AM

I was a little nervous about trying that, but I went ahead with it anyway and now everything is working perfectly. I am also quite impressed with Slackware at this early stage.

Thank you very much for your help.


All times are GMT -5. The time now is 11:22 PM.