parted refuses to work with a partition that goes beyond the end of disk

Bug #96976 reported by dan
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GParted
Fix Released
Critical
parted (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

(g)parted can not work with a disk that has a partition that goes beyond the end of the disk. It should report the problem, but allow you to ignore and so you can use parted to correct the issue instead of fdisk.

Revision history for this message
dan (dadan) wrote : Re: gparted shows empty disk =>attachments

sudo fdisk -l

Disque /dev/sda: 37.6 Go, 37688437248 octets
255 têtes, 63 secteurs/piste, 4582 cylindres
Unités = cylindres de 16065 * 512 = 8225280 octets

Périphérique Amorce Début Fin Blocs Id Système
/dev/sda1 * 1 637 5116671 7 HPFS/NTFS
/dev/sda2 638 1245 4883760 83 Linux
/dev/sda3 1246 1853 4883760 83 Linux
/dev/sda4 1854 4864 24185857+ 5 Extended
/dev/sda5 4800 4864 522112+ 82 Linux swap / Solaris
/dev/sda6 1854 4799 23663682 83 Linux

Revision history for this message
Ralph Janke (txwikinger) wrote : Re: gparted shows empty disk

Bug 104187 seems to be same same problem stating that the partition table is overlapping.

Revision history for this message
mazzitel (mazzitel) wrote :

I have the same problem,
does somebody know how I can Install ubuntu anyway?

Revision history for this message
Sam Liddicott (sam-liddicott) wrote :

If the partition table is bad with overlapping partitions or partitions beyond the disk boundry theb gparted shows no partitions.

You need to fix the partition table first and possibly resize the file systems, but sadly you can't use gparted to do this.

Be careful or gparted will trash your partition table.

Revision history for this message
mazzitel (mazzitel) wrote :

Sorry for my stupid question,
but don't you know how I can fix the partions?
Are there some tools to do it?

Revision history for this message
Sam Liddicott (sam-liddicott) wrote :

I suggest using sfdisk to backup your partition as text.

Then try editing a copy of the sfdisk output in a text editor.
You will have to analyse the output of sfdisk to work out what is wrong and then adjust the partition boundries your self in the sfdisk file.
Only play with partition size (end) not partition start.
Then you will have to play-back the file into sfdisk.

As long as this is all you do you ought also to be able to playback the original sfdisk file.

Once the partition table is OK you may need to re-size your filesystems so they are not bigger than your partitions.

AFAIK most filesystem types have tools to adjust the filesystem to be the same size as the partition.

Maybe you want to make them shrink a bit first? It's up to you.

Backup data first as you may loose file system data.
It's a hairy business but that what gparted is for.... oh....

Revision history for this message
komputes (komputes) wrote :

Example snapshot of cfdisk vs gparted.

Happened on Ubuntu 8.04 with a Samsung SpinPoint 320gb.

Revision history for this message
Achoth (tobias-hultgren) wrote :

As written above, GParted gives false information that the disk is completely unallocated, while other partition managers like cfdisk shows the correct partition table. Since Ubuntu uses GParted for the install, getting GParted to work is essential.
I solved it by using another partition manager to delete all the partitions I was going to use for the Ubuntu install, then GParted showed me the correct partition table allowing me to continue the install.
The problem was on Ubuntu 8.04 using a Samsung SpinPoint 320gb.

Revision history for this message
Colin Watson (cjwatson) wrote :

This is likely to be a bug in the underlying libparted library, rather than in gparted itself.

Note that, contrary to the most recent comment, Ubuntu 8.04 does *not* use gparted to install, but a separate implementation that also eventually uses libparted under the covers. The distinction matters since otherwise bugs go to the wrong place!

Revision history for this message
Savvas Radevic (medigeek) wrote :

Can someone try this on Ubuntu Intrepid Ibex 8.10 Live CD?
System > Administration > Partition Editor

Also provide the output of these commands (Applications > Accessories > Terminal):

lspci
lsusb
sudo lshw -C disk
sudo hdparm -i /dev/sd?

Revision history for this message
Savvas Radevic (medigeek) wrote :

I think this bug is connected to:
http://bugzilla.gnome.org/show_bug.cgi?id=337244

Looking at first comment here:
https://bugs.launchpad.net/ubuntu/+source/parted/+bug/96976/comments/1

And the assumption here:
http://bugzilla.gnome.org/show_bug.cgi?id=337244#c3

..it seems correct that the first partition "/dev/sda1 * 1 637 5116671 7 HPFS/NTFS" is overlapping (taking over) space from other partitions

Changed in parted:
status: Unknown → New
Revision history for this message
Gaetan Nadon (memsize) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!
BugSquad

Changed in parted:
status: New → Invalid
Revision history for this message
Sam Liddicott (sam-liddicott) wrote :

What more information do you need?

lspci and lsusb have nothing to do with the problem, nor does the disk type or settings.

Most people who have this problem don't have this problem for very long because they fix it; but you can reproduce the problem on any PC like this:

sudo sfdisk -d /dev/sdX | tee ORIG.$$ | sed 's/^\(.*start= *\)\([0-9]*\)\(.*\)/\1 63 \3/' | sudo sfdisk /dev/sdX

and produce an overlapping partition table by making all partitions start at position 63.

In such a case gparted wrongly shows that there are no partitions.

Sam

Changed in parted:
status: Invalid → New
Revision history for this message
Gaetan Nadon (memsize) wrote :

My mistake, I apologize.
For the record, I was able to reproduce the problem in Ubuntu Intrepid 8.10 as outlined above.
Thanks for reporting this bug and any supporting documentation. Since this bug has enough information provided, I'm going to mark it as confirmed and let development handle it from here. Thanks for taking the time to make Ubuntu better!
BugSquad

Changed in parted:
status: New → Confirmed
Revision history for this message
mac (amartin83) wrote :

Hi, does anybody did something about this bug?? I encounter it many times since start using linux, and it's making me really feel bad and angry!! fdisk -l shows everything is ok, but gparted shows empty disk :/

Revision history for this message
Przemysław Kochański (kochas315) wrote :

After a few hours i an found an ultimate solution:
(done under ubuntu 9.10 livecd)
1. Install testdisk from repo (sudo apt-get install testdisk)
2. Run testdisk from console (sudo testdisk)
3. select:
  "no log"
  (choose your drive) and "proceed"
  "intel"
  "analyse"
  "quick search" (if found not enough try "deeper search")
  press Y if you have Vista/Win7 or N otherwise
  "write"
4. It will write the correct partition table
5. (you dont need to restart) run gparted or ubuntu installer
6. now all partitions are visible!

Changed in parted:
importance: Unknown → Critical
status: New → Fix Released
Phillip Susi (psusi)
affects: parted → gparted
Changed in parted (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
summary: - gparted shows empty disk
+ parted refuses to work with a partition that goes beyond the end of disk
Changed in parted (Ubuntu):
importance: Medium → Wishlist
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.