Bug 1212507 - sfdisk-disk-geometry fails to display the disk geometry from the partition
Summary: sfdisk-disk-geometry fails to display the disk geometry from the partition
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-16 14:29 UTC by Hu Zhang
Modified: 2025-10-17 12:52 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-10-17 00:10:19 UTC
Embargoed:


Attachments (Terms of Use)

Description Hu Zhang 2015-04-16 14:29:19 UTC
Description of problem:
sfdisk-disk-geometry fails to display the disk geometry from the partition.

Version-Release number of selected component (if applicable):
kernel-4.0.0-0.rc1.git0.1.fc22.x86_64
libguestfs-1.29.33-1.fc22.x86_64

How reproducible:
Always

Steps to Reproduce:
1. guestfish -a $img
2. run
3. sfdisk-disk-geometry /dev/sda

Actual results:
libguestfs: error: sfdisk_disk_geometry: /dev/sda1: sfdisk: invalid option -- 'G'                                                                                           

Usage:                                                                                                                                                                      
 sfdisk [options] <dev> [[-N] <part>]                                                                                                                                       
 sfdisk [options] <command>
...

Expected results:
sfdisk-disk-geometry displays the disk geometry from the partition successfully.

Additional info:

Comment 1 Richard W.M. Jones 2015-04-16 14:59:30 UTC
Indeed the sfdisk -G option has disappeared in Rawhide.  So
actually this is a bug in sfdisk.

Comment 2 Karel Zak 2015-04-16 16:54:04 UTC
This is not a bug, but expected change. There is no reason to use CHS.

Comment 3 Karel Zak 2015-04-16 17:11:28 UTC
Maybe we can add --getgeo to blockdev to have command line interface to the ioctl.

Comment 4 Richard W.M. Jones 2015-04-16 17:58:25 UTC
I'm going to switch this back to libguestfs.

Obviously it's a completely useless API, and CHS has no real relevance
to anything (except maybe possibly bootloaders), but we should at least
find a way to emulate it.

Comment 5 Karel Zak 2015-04-23 10:56:12 UTC
I forgot one thing, the new sfdisk still supports 

   -g, --show-geometry

to print disk geometry as returned by kernel ioctl (so ignore my comment #3:-)

# sfdisk --show-geometry /dev/sda
/dev/sda: 29185 cylinders, 255 heads, 63 sectors/track


The original sfdisk also provided 

   -G, --show-pt-geometry

to guess the geometry from partition table. This is no more supported by new sfdisk. (Note that the result from kernel and from PT is usually the same.)

Comment 7 Red Hat Bugzilla 2025-10-17 00:10:19 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.

Comment 8 Alasdair Kergon 2025-10-17 12:52:13 UTC
Reopening because Virtualization Tools has not been discontinued.


Note You need to log in before you can comment on or make changes to this bug.