Problems with "Partitions on Local Disks" module in fdisk mode

When I set the module to mode "fdisk", under Ubuntu 12, the "Total Size" column is empty.

In the details for a disk, the Cylinder count is an incorrect very high number. "Size" is given in blocks instead of GB, and the start and end cylinder are incorrect.

Also, when trying to create a new partition on an empty disk, the process fails and the webpage loads endlessly.

Status: 
Closed (fixed)

Comments

Is this Ubuntu 12.04, or a later version?

Also, could you post the output from the commands fdisk -l /dev/sda and parted /dev/sda unit cyl print ?

Replace /dev/sda with the root disk from your system ..

It's an Ubuntu 12.04 LTS with all packets updated to latest versions.

I can see where you're going with your question. :) It indeed seems the default behavior of fdisk has changed. Output of fdisk -l /dev/sda on Ubuntu 12:

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders, total 52428800 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: 0x0003c924
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    52426751    26212352   83  Linux

For comparison on Ubuntu 10. Units was "cylinders" back then and has changed to sectors on Ubuntu 12, hence the large size values.

Disk /dev/sda: 26.8 GB, 26843545600 bytes
64 heads, 32 sectors/track, 25600 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x25330869
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               2       25600    26213376   83  Linux

The output for parted /dev/sda unit cyl print is identical on both systems, probably due to the "unit cyl" directive which actively selects the right unit:

Model: VMware Virtual disk (scsi)
Disk /dev/sda: 3263cyl
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 3263,255,63.  Each cylinder is 8225kB.
Partition Table: msdos
 
Number  Start  End      Size     Type     File system  Flags
 1      0cyl   3263cyl  3263cyl  primary  ext4         boot

That output format actually looks fine.

Could you attach or email me a screenshot of the page that is showing the incorrect size?

Also, on the main page of the Partitions on Local Disks module, what does it say under the title - either "Using fdisk" or "Using parted" ?

Certainly, please find the screenshots attached.

Under the title, it says "Using parted" when I choose "Automatically" or "parted" in the module config, otherwise it says "Using fdisk" when I force that. The problem only occurs in fdisk mode.

The first screenshot shows the disk overview, with empty size column. SCSI device A should have 25.59 GB size.

The second screenshot shows the details for device A. Cylinder count should be 3264, and the size is missing.

Also, please remember that it's not only incorrectly displayed. When I try to create a partition in fdisk mode, the page loads endlessly (script hangs).

Ok, that makes sense now. I will fix Webmin in the 1.610 release to force fdisk to output sizes in cylinders, so that my parsing code works properly..