fdisk creates partition beyond end of disk

Bug #605720 reported by Keith Cornwell
32
This bug affects 3 people
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Binary package hint: util-linux

fdisk creates a partition with the last cylinder 1 greater than the last available cylinder on the disk.

This is probably the root of the problem with this server installation bug: #569900

I was able to reproduce this on two 500GB drives, one was Seagate and the other WD. The total cylinder and sector count was the same on both drives.

# fdisk -l /dev/sda

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 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: 0x00068cd4

Starting with no partitions defined I started fdisk and turned off the DOS compatibility mode and changed the units to sectors.
I created partition 1 as Primary, starting at sector 2048 and size +1G.
I created partition 2 as Primary, starting at the default and using the rest of the drive.

If I change the units back to cylinders and then print the table the last cylinder on the second partition is 60802.
If I start with the units set to cylinders, it works properly and sets the last cylinder to 60801.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: util-linux 2.17.2-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-21.32-generic-pae 2.6.32.11+drm33.2
Uname: Linux 2.6.32-21-generic-pae i686
Architecture: i386
Date: Wed Jul 14 23:17:46 2010
InstallationMedia: Ubuntu-Server 10.04 LTS "Lucid Lynx" - Release i386 (20100427)
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_US.UTF-8
SourcePackage: util-linux

Revision history for this message
Keith Cornwell (apex-thing2) wrote :
Thierry Carrez (ttx)
Changed in util-linux (Ubuntu):
importance: Undecided → High
Revision history for this message
Jean-Luc Boss (jlb74) wrote :

Got the same error on an Optiplex 780 with two 500Gb disks...

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

It's not clear to me whether this is a bug.

I created a test disk image in kvm of exactly the same size and followed your directions. The second partition doesn't actually extend beyond the end of the disk. It does extend one cylinder beyond the count shown by fdisk, but that's because the last sector on the disk is after the last cylinder - i.e. the last cylinder is incomplete. There's an argument that that's what you ask for by turning off cylinder mode. I don't think this bug should necessarily be closed out of hand, but it doesn't seem entirely unreasonable behaviour from a relatively low-level tool like fdisk.

Bug 569900 is going to be something different, because the installer doesn't use fdisk.

Changed in util-linux (Ubuntu):
importance: High → Medium
status: New → Triaged
Revision history for this message
Phillip Susi (psusi) wrote :

Seems pretty clear to me that this is not a bug. fdisk reports the number of *whole* cylinders on the disk, so using sector mode to use part of the last partial cylinder correctly shows it as ending one cylinder above the reported whole cylinder count.

Changed in util-linux (Ubuntu):
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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