1 (edited by starvulk 2011-04-28 00:24:29)

Topic: [SOLVED]Can't have overlapping partitions

too long, didn't read?
I formatted a new partition on my drive with the old windows 95 fdisk utility, then set it to active. Now there is nothing on that partition so my PC won't boot my existing windows 7 install. I'd like to restore my drive to the way it was before I used fdisk. Gparted sees the drive as unallocated and lists an error "can't have overlapping partitions".



Hi all,

I am new here but I am full of hope that this is the right place to ask my question.

I ran an old version of the windows fdisk tool on a drive with 4 partitions (the 4th one was just unpartitioned space). I used it to format the last partition into FAT32 and then set that partition to active. Afterwards I tried installing XP on that 4th partition, but it didn't work. Now, my computer won't boot because an empty partition is set to active.

I ran Ubuntu 10.10 LiveCD and I was worried when I realized that gparted sees my drive as unallocated, and lists an error message "can't have overlapping partitions".

Here is the output from fdisk -l:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd83b5f0d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1127     9043968   27  Unknown
/dev/sda2            1127        1139      102400    7  HPFS/NTFS
/dev/sda3            1139       54428   428037144    7  HPFS/NTFS
/dev/sda4   *       54428       60801    51199155    c  W95 FAT32 (LBA)

I'd like to get rid of /dev/sda4 and set /dev/sda2 as active, as it was before, and I hope that will let me boot back into my existing installation of windows 7. However, I am afraid of doing anything to the drive, since my critical information is on /dev/sda3 and I'd rather not lose it... Is there any way to undo whatever that old W95 fdisk did to my drive?

Thanks in advance!

2

Re: [SOLVED]Can't have overlapping partitions

In order to diagnose the problem of overlapping partitions, would you be able to provide the output from the following two commands?

fdisk -l -u

where one of the options is a lower case "L" and not the number one.

parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/sda.

3

Re: [SOLVED]Can't have overlapping partitions

Hi gedakc, thank you for your input. It turns out I solved my problem, so I will go ahead and write out the solution in case anyone has the same problem.

First, for completeness, I'll mention that the Ubuntu disk utility was giving me extremely weird information that I didn't include in my first post: it showed two 438GB partitions one after the other on a 500GB hard drive. After the second 438GB partition, there were two unformatted partitions.

The solution to my problem was to download Ubuntu Rescue Remix 10.10, burn the liveCD and run the testdisk tool. Here is a walkthrough (pretty much the same as http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step):
sudo -s
testdisk /list
testdisk

In testdisk, I went with "no log", then chose my drive, chose "intel" which was the right type for my PC, then "analyse" and "quick search". I was very disappointed to see the results returned by quick search -- only the very first partition, the recovery partition on my PC, could be saved (check each partition by selecting it and pressing p, if the files on the partition are readable it is recoverable). That is why I went on to choose "deeper search".

"Deeper search" was the holy grail, as it found the other two partitions in working order as well! I checked them by pressing "p" and the partitions were readable. I changed each of them from "D" (deleted) to "P", marked my boot partition as "*" and finally pressed Enter, then "write" and wrote the restored partition table.

Note: to save time, you can interrupt the deeper search after you think it has found what you are looking for. I knew the first 3 partitions started before cylinder 2000, so they had been discovered by then and I stopped the search. I didn't care about the fourth partition.

4

Re: [SOLVED]Can't have overlapping partitions

Thanks for reporting back with how you solved the problem.  To help other users searching, you can edit the initial post to prefix "SOLVED" in front of the title.