The following post by Old-Polack has been transferred from another thread (Moving Windows partition with GParted) which was going off topic:
If fdisk can't read the drive properly, in it's present state, neither can the rest of the applications. What's being reported is a combination of flags left behind by previous partitioning and it will only confuse things and make them worse, if you try to install anything new. The partition table needs to be rebuilt, and stabilized, before you can proceed with anything else.
It wound take writing a book to explain fully what I think is happening, and there are already plenty of them around, so I'll try with a short form version.
1. The partition table provides for 4 primary partitions only.
2 If more partitions are needed 1 of the primaries can become an extended partition.
3 An extended partition acts as a container, to hold logical partitions.
4 The extended partition should be the last primary partition used, and should start at the first cylinder after the previous primary partition, and extend to the end of the drive.
5 If the extended partition begins before the end of a primary partition, or if a primary partition is included within the extended partition, it is said to be overlapping.
6 Some software, mostly GUI, is written so that it still works with overlapping partitions, whether by design or sloppy coding.
7 Software that allows this is very bad practice, as it leads to problems such as you are experiencing, where other software, with more strict rules, becomes totally confused.
8 Depending on how the partitions are actually written to disk, Linux can still, sometimes, work with these odd arrangements, but if they get changed, and the change is written slightly different, the whole thing becomes total confusion, and the apps like fdisk can no longer make sense of what information is left.
9 When you created the partition on /dev/hda1 you created it as an extended partition, which extended to the end of the drive.
10 The windows partition now became a totally overlapping partition; a primary partition, withing the extended partition. This is very bad practice, and should not have been allowed in the first place.
11 However this was handled, and written to disk, fdisk was still able to sort it out, at the time.
12 Whatever has changed since then, while trying to remove the first partition, which was an extended partition, properly holding /dev/hda5 through /dev/hda8, and improperly holding the primary windows partition, /dev/hda2, has thrown the whole partitioning scheme into disarray.
13 If you have not tried to write further to the drive, overwriting the information/data on the disk, we should be able to recreate a correct partition table, using the same boundaries for each partition, but with correct partition form for each, making the partitions both accessible, and able to be properly manipulated by GParted.
These are the partitions as they were. All we need to concern ourselves with, at this time are the boundaries; the start and end cylinders.
Quote from: Riki on July 28, 2009, 08:25:21 AM
[root@localhost root]# fdisk -l
Disk /dev/hda: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0x17df17de
Device Boot Start End Blocks Id System
/dev/hda1 1 155061 78150712+ 5 Extended
/dev/hda2 * 12496 64812 26367768 7 HPFS/NTFS
/dev/hda5 1 12495 6297417 83 Linux
/dev/hda6 64813 72938 4095472+ 83 Linux
/dev/hda7 72939 75018 1048288+ 82 Linux swap / Solaris
/dev/hda8 75019 155061 40341640+ 83 Linux
The partitions we would want to create would take this form;
Device Start End Type
/dev/hda1 1 12495 Primary
/dev/hda2 12496 64812 Primary
/dev/hda3 64813 155061 Extended
/dev/hda5 64813 72938 Logical
/dev/hda6 72939 75018 Logical
/dev/hda7 75019 155061 Logical
If we can get this far, the individual partitions should be able to be read and used. There would need to be further edits to /etc/fstab on the new /dev/hda5, and also to the /boot/grub/menu.lst on that partition, so that it and Windows could then be booted, to check out whether Windows has truly survived all this. Grub would need to be reinstalled to the MBR for this purpose.
If we can still get both systems to run, (Actually there are three, counting the one on the new /dev/hda1) and if GParted can now see them, you should then be able to eliminate /dev/hda1, and move /dev/hda2 to the beginning of the drive, where it could then be fixed, with fdisk, to become /dev/hda1.
Should we get that far, The Linux involved partitions should also be able to be either fixed by growing, moving etc. or can be eliminated, for a fresh installation with correct partitions. As you don't have a backed up version of the Windows MBR boot code, you would not be able to use Windows, without a working grub installed, or you would have to find an image of a Win98 repair floppy to burn to a floppy disk, to restore the Windows code to the MBR. These are available on the web,
Two other choices that everyone running a dual boot with Windows and Linux should have, are the Ultimate Boot CDs.http://www.ultimatebootcd.com/
<-- General purposehttp://www.ubcd4win.com/
<-- Windows specific
One, or both, of the above should have an app to restore the Windows MBR code.
« Last Edit: August 02, 2009, 11:11:26 PM by old-polack » Report to moderator Logged
Of what use be there for joy, if not for the sharing thereof?