partition does not end on cyl boundary -> disks-admin reports fake empty space

Bug #67529 reported by Patrick Hendrickx
2
Affects Status Importance Assigned to Milestone
gnome-system-tools (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: gnome-system-tools

I installed Ubuntu 6.06 LTS on a disk where the partitions are not aligned with cylinder boundaries. The disks-admin tool does not handle this situation correctly: it reports 4096 GB (!) empty space in between partitions.

description: updated
Revision history for this message
Patrick Hendrickx (patrick-hendrickx1) wrote :

Version information and result of fdisk -l are as follows:

# uname -r
2.6.15-27-386

# disks-admin --version
Gnome disks-admin 2.14.0

# /usr/share/setup-tool-backends/scripts/disks-conf --version
disks 1.4.2

# fdisk -v
fdisk v2.12r

# fdisk -l /dev/hda

Disk /dev/hda: 61.4 GB, 61492838400 bytes
16 heads, 63 sectors/track, 119150 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot Start End Blocks Id System
/dev/hda1 * 1 48442 24414736+ 7 HPFS/NTFS
/dev/hda2 48451 50522 1044225 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/hda3 50522 111467 30716280 83 Linux
Partition 3 does not end on cylinder boundary.
/dev/hda4 111467 119149 3871665 b W95 FAT32
Partition 4 does not end on cylinder boundary.

Attached is a screenshot of how disks-admin handles the situation. Note that the first empty space reported is correct, the other two are bogus.

Revision history for this message
Patrick Hendrickx (patrick-hendrickx1) wrote :

Digged deeper into this and found the following:

/usr/share/setup-tool-backends/scripts/partition.pl scans for empty space by comparing the start of a partition with the end of the previous partition. If these are not on subsequent cylinders, the script assumes empty space.

If a partition starts on the same cylinder as its predecessor, the code on line 578 and following assumes an empty space of -1 cylinders. I can see the corresponding size of -504 KB in the XML file that is returned to the GUI frontend.

The 4096 GB is probably caused by a signed/unsigned conversion in the GUI frontend, although I did not check that.

Changed the test in partition.pl to handle the case of a new partition starting on the same cylinder as its predecessor. All works well now. Patch is attached.

Revision history for this message
Wouter Stomp (wouterstomp-deactivatedaccount) wrote :

Marking as invalid, as disks-admin was removed from gnome-system-tools in ubuntu a long time ago.

Changed in gnome-system-tools:
status: New → Invalid
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.