Ubuntu – Gparted won’t read partition table

gpartedpartitioninguninstall

I just recently removed two Linux operating systems (mint and ubuntu) from my computer, which also contains a windows vista installation. I removed both with the "OSremover" found on boot-repair-disk's live image.

Before removing Ubuntu I forgot that I had encrypted the home directory. The removal worked just fine, and now I can boot into windows as usual.

However, now that I'm trying to install a new Linux OS, I can see that gparted doesn't recognize any partitions on my disk and it says that all of the space there is unallocated. I checked with the disk management service on windows and it can see all my partitions just fine, even the ones I previously used for the two Linux installations (which I've deleted and merged with my windows partition).

I have no idea what's going on, I've tried fixing the mbr with bootrec /fixmbr but that didn't do anything. Also, running fdisk -l from a live image of elementary-os lists my partitions as they should be.

I'm adding outputs from the from the sudo fdisk -l /dev/sda and /sudo parted /dev/sda print commands as per Rod Smith's suggestion. First, fdisk:

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcab10bee

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   484458486   242229212    7  HPFS/NTFS/exFAT
/dev/sda2       484472205   488408129     1967962+   f  W95 Ext'd (LBA)
/dev/sda5       486434816   488396783      980984   82  Linux swap / Solaris

Now, parted:

Error: Can't have a partition outside the disk!           

Hope this helps.

Solution:

Ran fixparts and it automatically fixed the error on execution, just had to save the new table with the w command.

Concern:

Received the following message:

Warning: 0xEE partition doesn't start on sector 1. This can cause problems
in some OSes.

Best Answer

Chances are your partition table is damaged, or possibly just a little bit odd. GParted tends to show disks with such partition tables as being completely empty (with no partitions), which is unhelpful.

The solution is to fix the partition table. Unfortunately, it's unclear from your post exactly what's wrong with the partition table. Posting the output of sudo fdisk -l /dev/sda and of sudo parted /dev/sda print might give some clues about what's wrong.

You could also try running my FixParts on the disk, although it's probably better to try to figure out what's wrong first. FixParts can fix a number of common problems, but if used inappropriately it could conceivably cause more damage -- hence my recommendation to post your partition data here first. (You can add this information by editing your post. Be sure to add four spaces to the start of each line of program output; this is a flag to the forum software to preserve the formatting.) Please add a comment to this answer if you add this information; that way I'll notice and check back.


EDIT: Your problem is that your disk is 488,397,168 sectors long, but your extended partition extends out to sector 488,408,129. Fortunately, the logical partition within the extended partition is of legal size. This is one of the problems that FixParts can fix, so try using it. Be sure to read its documentation first. The solution is fairly simple, but you have to know at least the basics of how to use the program; it won't guide you by the hand through the process.

Related Question