Well I’ve fixed it, sort of. For anyone who wants to know, I’ll post the general steps. This is for people who have data they need to save!
Problem:
By using Paragon partition manager, I screwed up my partition table to an extent where it wasn’t possible to be read for partition changes but still could be read to use a partition.
The fix involved making a backup copy of the partition table, and reconstructing it as closely as possible using fdisk, or if preferred cfdisk.
Step 1
Find a Linux Live CD so you can boot into a recovery environment without having to mount any of your disk partitions. For mine, I used Knoppix 5.1 and it worked very well.
Once inside this environment, open up a terminal and login as root with su
From here, do fdisk -lto see a basic idea of what your partition table looks like. To save this partition table and its geometry (like cylinders, heads and sectors/track) do fdisk -l > /root/partitions. Or you can save that file onto a pen drive for safer backup as the file will disappear when you reboot.
The partition table is kept in the MBR, Master Boot Record and is found on the block device /dev/hda (this device can be different, in this case its the first drive on the primary IDE channel)
To make a backup of your MBR, use the dd command to make a byte exact copy of it. dd if=/dev/hda of=/root/mbr.bin bs=512 count=1
Caution: Just because you have a backup of your partition table/MBR doesn’t mean that your data is safe. If you mess around with the partitions, create new ones/delete old ones then you could destroy your data. It’s important not to make any changes to the data while doing maintenance.
Using cfdisk or fdisk
Now you’ll need to wipe your partition table clean, and start afresh. Using fdisk, you can use the ‘m’ key to find a list of commands. Its pretty straight forward. First press ‘p’ to print the current table to the screen. If you haven’t already done so, make some notes about the number of cylinders, sectors per track and heads.
Now, use the appropriate command to create a blank partition table. This will leave you with a clean table where you can add the appropriate new partitions. Remember, if you’re using a Windows dual boot to use the msdos table format when prompted.
Press ‘x’ to go to expert mode, then press m to see a new list of commands. Use the appropriate commands to specify the cylinders, heads and sectors information if its not already correct.
Press r to go back to the main menu. Use the ‘n’ key to add partitions to the blank one from your backup. I suggest that for simplicity’s sake you only add partitions which you need. When creating the new partition, specify the cylinder start/end numbers. Then use the ‘t’ command to change a partitions type id to the one in your backup. E.g. Linux type 83, for Windows its 7 for NTFS.
Unfortunately, because it can get really complicated I can only help so far. There can be 4 primary partitions, if you want more then you need to make 3 primary partitions and make the fourth an extended partition where you can divide it into more logical ones.
Once you’ve added all the info, go to expert mode and press ‘f’ to fix the partition order. Then go back to the main menu and once you’re done, look carefully at the new table and press w to write the table to disk.
Now what?
Reboot, and most likely if you’ve changed the table from the backup in a small way your bootloader won’t work. Hopefully your partitions are still safe and working, and you can use a recovery CD to reinstall the bootloader.