After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 624078 - No partitions detected
No partitions detected
Status: RESOLVED NOTGNOME
Product: gparted
Classification: Other
Component: application
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2010-07-11 02:27 UTC by ali
Modified: 2016-10-09 16:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Disk_Utility (82.14 KB, image/png)
2010-07-11 02:28 UTC, ali
Details
Gparted (124.47 KB, image/png)
2010-07-11 02:30 UTC, ali
Details

Description ali 2010-07-11 02:27:04 UTC
I have tested the following problem with with several versions of Gparted, including version 0.6.0 with several OSes.

The picture "Gparted.png" shows what the problem is. Basically no partitions are detected with Gparted. However, if you look at the second picture where I used "Disk Utitily" you can see that all of the partitions are detected. And you can also see more info about my HDD.
Comment 1 ali 2010-07-11 02:28:23 UTC
Created attachment 165658 [details]
Disk_Utility
Comment 2 ali 2010-07-11 02:30:50 UTC
Created attachment 165659 [details]
Gparted

This should have been the first attachment.
Comment 3 Curtis Gedak 2010-07-11 21:13:39 UTC
From the GParted picture, I can see that there must be at least one partition that goes beyond the size of the disk.

To learn which partition is causing this problem, would you be able to provide the output from the following command?

     fdisk -l -u

Where one of the above options is a lower case "L" and not the number one.
Comment 4 ali 2010-07-12 04:46:05 UTC
root@PartedMagic:~# fdisk -l -u

Disk /dev/sda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders, total 160836480 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: 0xe506da1f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    59167394    29583666    7  HPFS/NTFS
/dev/sda2        59168768   111390719    26110976   83  Linux
/dev/sda3       111390720   113848303     1228792   82  Linux swap / Solaris
/dev/sda4       113848308   160842779    23497236    f  W95 Ext'd (LBA)
/dev/sda5       113848320   160826714    23489197+   7  HPFS/NTFS
root@PartedMagic:~#
Comment 5 Curtis Gedak 2010-07-12 17:53:46 UTC
It looks like the extended partition (/dev/sda4) goes beyond the end of the disk.

160,836,480 total sectors on disk
160,842,779 end sector of /dev/sda4 (this is not possible)

Parted does not permit editing of invalid partition tables.  Since GParted uses the library libparted from the parted project, GParted also has this limitation.

This error in the partition table will need to be fixed before GParted or parted can edit the partition table.  I can think of two ways to do this:

1)  Backup /dev/sda5, then delete /dev/sda4 and /dev/sda5 using a tool such as fdisk.  You should then be able to use either Parted or GParted to recreate the extended partition (/dev/sda4) and your logical partition (/dev/sda5).  Then restore the data to /dev/sda5.

2)  Use fdisk to remove /dev/sda5 and /dev/sda4, and then carefully recreate these partitions using the correct sector values.  Extreme caution is required while doing this to ensure that you do not lose your data.
Comment 6 ali 2010-07-13 14:38:39 UTC
Thanks, 

I am not worried too much about fixing MY problem because I don't have any sensitive data,

Anyways, why is it possible to see the partitions with Disk Utility? Does it use a different library?  You said this to be a limitation with Libparted, so do you think this can be fixed upstream?

I propose a temporary solution for this: In a case where the partitions go beyond the disk, have Gparted warn the user that there could be partitions on the disk but just the has a limitation and is not able to detect them, so they should use a different program. Such a message would be useful in other situations where Gparted cannot detect partitions or data on partitions, which too happens frequently.
Comment 7 Curtis Gedak 2010-07-13 20:15:02 UTC
I suspect that Disk Utility does not use the libparted library, but I do not know for sure.

You could try logging this problem upstream.  To recreate the problem using parted only, you could try the command:

     parted /dev/sda unit s print

The parted team uses the bug-parted@gnu.org mailing list to report problems such as these.
Comment 8 Curtis Gedak 2010-07-15 15:51:13 UTC
Thank you ali for reporting this problem upstream.

Following is a link to the post to the bug-parted mailing list:
http://lists.gnu.org/archive/html/bug-parted/2010-07/msg00010.html
Comment 9 Curtis Gedak 2010-07-15 16:09:28 UTC
A similar problem is listed in bug #614220 - Unable to satisfy all constraints on the partition.
Comment 10 Aldian 2010-07-21 10:22:38 UTC
Hi

Same bug for me. Originally, it worked, but after a few complex manipulations, it suddenly didn't work any more.

Here are two screenshots:

bug: http://i37.servimg.com/u/f37/10/07/27/39/parted10.jpg
packages versions : http://i37.servimg.com/u/f37/10/07/27/39/gparte10.jpg
Comment 11 Curtis Gedak 2010-07-21 15:49:23 UTC
Aldian, did you use GParted for all of the complex manipulations?

If so, what were the steps you used before this problem arose?

If you used another tool for some of the complex manipulations, which one did you use?

You can view the reason why GParted will not display the partition table by selecting the device in the text portion of the display and choosing the menu option "Partition --> Information".  If there is an error message it will be displayed in this dialog box.
Comment 12 Aldian 2010-07-21 20:24:30 UTC
I used Gparted for all the complex operations like deleting, creating, shrinking, or expanding partitions, but I also made two reinstallations of Ubuntu during the process, and I let the installation program (I think it is ubiquity-frontend-gtk) format some partitions as its will.

Gparted gives me no error message : http://i37.servimg.com/u/f37/10/07/27/39/gparte11.png but if you look closely at my former screenshot : http://i37.servimg.com/u/f37/10/07/27/39/gparte10.jpg you will notice something weird at the end of the disk: it says there is a void partition with 18446744074GB free

As for the steps I used, there were many. As far as I remember, here are my former partitions:
/dev/sda1 :   6GB - fat 32
/dev/sda2 :  22GB - ntfs, WinXP
/dev/sda3 :  62GB - ntfs, Win7
/dev/sda4 :    1B - extended
/dev/sda5 :  21GB - ext4, ubuntustudio 10.04
/dev/sda6 : 110GB - ext3, /home of ubuntu 9.10
/dev/sda7 :  27GB - ext3, data
/dev/sda8 :  23GB - ext4, /, root of ubuntu 9.10
/dev/sda9 :  30GB - ext4, void
/dev/sda10 :  6GB - linux swap

My idea was to reinstall ubuntu 10.04 on /dev/sda5, but I wanted to have a separate partition for /boot and for /usr/local. So I restarted on a live USB of Ubuntu 10.04 and performed the folowing steps

1) delete /dev/sda5
2) create at the beginning of the freed space a 500 MB ext3 partition (/dev/sda11)
3) create in the remaining space an ext4 partition (/dev/sda12)
4) shrink /dev/sda9 to 20GB
5) create in the freed 10 GB an ext3 partition (/dev/sda13)

After that there was something odd, because the partition numbers were not sorted well, it was 1,2,3,4,11,12,6,7,8,9,13,10 with no n°5. But I kept going and used the graphical interface to install Ubuntu 10.04 using the manual mode to select the correct partitions.

After the restart of the computer, I had several issues with Grub and I had to use a super grub disk. After some times, I decided to reinstall again, but with no separted /boot partition since I wasn't able to figure how to make this work on my system. So I restarted on a live USB of Ubuntu 10.04 and performed the folowing steps (gparted was still working):

1) delete /dev/sda11
2) format /dev/sda12
3) expand /dev/sda12 on the space freed by /dev/sda11 deletion.

Then I reinstalled the same way. After this I kept having issues with grub. I have to mention that I was trying to preserve Windows 7 bootloader, so I had used easyBCD2.0b60 to chainload to grub. This program uses a file of 512 bytes which is the copy of what the MBR would be in case grub would have been installed there. So I tried to manually recreate this file by performing the folowing steps:

1) save the current mbr with dd
2) install grub in the mbr
3) save the mbr in the file I need
4) restore the mbr as it was from the 1) backup.

At some moment I wanted to check something about my partitions, so I used Gparted and saw it wasn't working anymore. Then I checked my partitions, and saw that some of them were still there, but not all. So came back on my live USB, installed testdisk, redetected all my partitions, and rewrote my correct partition table with testdisk.

After that my system was in the state it is currently.

Thank you for reading the long explanation, and sorry for my bad english.
Comment 13 Curtis Gedak 2010-07-23 16:06:07 UTC
GParted uses the libparted library from the parted project.  Hence any problems with this library will also be shown in the text output from parted.

To try to figure out why GParted is not displaying a partition table, would you be able to post the output from the following command?

     parted /dev/sda unit s print
Comment 14 Aldian 2010-07-23 18:57:02 UTC
$ sudo parted /dev/sda unit s print
[sudo] password for aldian: 
Erreur: La partition ne peut pas être en dehors du disque ! 


In case you wouldn't have figured out, it says "error, the partition can't be read outside the disk !"
Comment 15 Curtis Gedak 2010-07-23 19:21:27 UTC
It would appear that one of the partitions in the partition table extends beyond the end of the physical disk device.

To determine which partition is at fault would you please provide the output from the following command:

     fdisk -l -u /dev/sda
Comment 16 Aldian 2010-07-23 19:25:00 UTC
$ sudo fdisk -l -u /dev/sda
[sudo] password for aldian: 

Disque /dev/sda: 320.1 Go, 320072933376 octets
255 têtes, 63 secteurs/piste, 38913 cylindres, total 625142448 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Identifiant de disque : 0x000a81db

Périphérique Amorce  Début        Fin      Blocs     Id  Système
/dev/sda1   *          63    13317884     6658911    b  W95 FAT32
/dev/sda2        13317885    64517039    25599577+   7  HPFS/NTFS
/dev/sda3        64517040   197631629    66557295    7  HPFS/NTFS
/dev/sda4       197631630   625153409   213760890    f  W95 Etendue (LBA)
/dev/sda5       197647821   238613444    20482812   83  Linux
/dev/sda6       238613508   453113324   107249908+  83  Linux
/dev/sda7       453113388   506352734    26619673+  83  Linux
/dev/sda8       506352798   551398994    22523098+  83  Linux
/dev/sda9       551399058   571930064    10265503+  83  Linux
/dev/sda10      571930128   612847619    20458746   83  Linux
/dev/sda11      612847683   625137344     6144831   82  Linux swap / Solaris
$


If you need translation for french terms, just ask ;)
Comment 17 Aldian 2010-07-23 19:27:57 UTC
it would seem /dev/sda4 (extended) has 10961 sectors outside the disk
Comment 18 Curtis Gedak 2010-07-23 19:38:42 UTC
Good sleuth work.  You have found the source of the problem.  :-)

To fix the problem involves using a tools such as fdisk to remove and recreate the extended partition (and logical) partitions with the proper values.

A quicker way would be to use a hex editor to directly change the length of partition /dev/sda4 to be within the physical limits of the disk device.

The format of the partition table can be found at the following link:
http://en.wikipedia.org/wiki/Master_boot_record

I would advise making a backup copy of the partition table (first sector of the disk device) in case anything goes wrong.  That way you can restore if needed.

You can create a backup of the MBR with the following command:

     dd if=/dev/sda of=sda.mbr bs=512 count=1

where sda.mbr is the name of the file containing the partition table.


The problem with the libparted library not permitting editing of invalid partition tables has been raised to the parted mailing list as seen in comment #8.
Comment 19 Aldian 2010-07-23 21:08:32 UTC
Ok thank you for the advice, I think I will now go on the forum to ask for issues about the fixing. I have some difficulties figuring out the CHS coding, but with time, a paper, a pen and an hexa converter, I may find out :)

Just in case, here is the content of my hexa editor:
http://i37.servimg.com/u/f37/10/07/27/39/hexa10.png
Comment 20 Aldian 2011-01-16 23:51:39 UTC
Just for information, in case someone else has the problem, here was the solution (cf picture in my previous message)
00 = non actif
FE FF FF = @start
0F = W95 LBA
FE FF FF = @end
8E 9E C7 0B = 197631630
F4 76 7B 19 = 427521780

the sum gives just 10961 sectors outside the disc. I subtracted 10961 plus a little more since the last sector isn't complete to the las numer, and it solved the problem.
Comment 21 Phillip Susi 2013-02-28 20:14:50 UTC
Hey Curtis, I think this one should be closed as NOTGNOME since it is a missing feature in parted, not a bug in gparted.

FYI, I do have some patches to allow parted to ignore this kind of error and let the user fix it, hopefully they will make it into the next parted release.
Comment 22 Curtis Gedak 2013-02-28 22:22:30 UTC
Hi Phillip.  With this problem I think it would help if GParted would at least display the libparted error message in the disk graphic.

For example, instead of displaying "unallocated" the disk graphic could show "Can't have a partition outside the disk!".  That would help to make the problem obvious to the user.

Currently the user will see a triangle with an exclamation point beside the device entry.  The user must double click this entry to learn what the cause of the problem.
Comment 23 Curtis Gedak 2016-10-09 16:36:08 UTC
Closing report as NOTGNOME since it is a missing feature in parted.