Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question is similar to others, but none of the answers was conclusive for my case.

I have Windows XP installed on my laptop by default and later on I installed ubuntu 10.10. Grub2 is my bootloader and I can boot into both Windows and Ubuntu.

However, recently I decided to give my Ubuntu partition more space. I opened GParted but it only shows me "unallocated" for my sda drive (only drive in the laptop).

Running System->Administration->Disk-Utility I can see all my partitions

sudo parted -l gives:

Error: Cannot have a partition outside the disk

Yesterday I stared an attempt to fix this, but ended up destroying grub2 which required some reinstall-trickery. I also installed Boot-repair, but it only says something along the lines of:

Use a 64bits version

My system is 32bit, no doubt about it.

Just to complete everything, this is the fdisk output:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 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: 0xdcdcfe52

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         912     7325608+   7  HPFS/NTFS
/dev/sda2             913       10639    78132127+   7  HPFS/NTFS
/dev/sda3           10640       17544    55464381    7  HPFS/NTFS
/dev/sda4           17545       19458    15374205    f  W95 Ext'd (LBA)
/dev/sda5           17545       17756     1697860   83  Linux
/dev/sda6           17756       19380    13046784   83  Linux
/dev/sda7           19380       19458      621560   82  Linux swap / Solaris

(HDD was originally split half and half in a C: and D: drive. I used a part of the C:\ partition to install Ubuntu)

How can I fix my patitions in a way that GParted can find them again?

share|improve this question
I don't know if you've seen this, but this person seems to have a suspiciously similar problem as you. Both of you have an end point one cylinder past the end of the disk (sda4 ends at 19458, but you only have 19457 cylinders). Maybe follow some of those commands and see if you can fix your situation. – Kris Harper Aug 22 '11 at 20:38
I will try this tonight. Seems like my extended partition also ends 1 cylinder too late – Martin H Aug 23 '11 at 14:16
Did you solve this problem, or are you still looking for help? – coversnail Apr 2 '12 at 20:07
I did solve it but I can't recall now how I did it. Otherwise I would have given myself an answer. I used some boot repair distribution that fixed my problem. As soon as I can remeber I will post the answer – Martin H Apr 2 '12 at 20:29
up vote 2 down vote accepted

Please follow this link In short just follow this steps:

You need FixParts utility. You can either download the appropriate fixparts Debian file from SourceForge or install the full gptfdisk package for your version of Ubuntu (see the "Downloading GPT fdisk from OBS" section of this page). Then:

Back up your data, or at least your partition table. (Your sfdisk output above backs up your partition table, so save that on another disk.)
Type "sudo fixparts /dev/sda".
In FixParts, type "p" to view your partitions and verify they're all present. The extended partition won't show up, but the logical it contains should. 
In FixParts, type "w" to save your partition table.

This procedure should fix the problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.