Bug 1275135

Summary: RHEL6: "sfdisk -s" can't list the disk size
Product: Red Hat Enterprise Linux 6 Reporter: wangleziji <sunnychuanqi>
Component: util-linux-ngAssignee: Karel Zak <kzak>
Status: CLOSED ERRATA QA Contact: Vaclav Danek <vdanek>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7CC: psklenar, sunnychuanqi, vdanek
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: util-linux-ng-2.17.2-12.26.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1402825 (view as bug list) Environment:
Last Closed: 2017-03-21 11:26:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1356047, 1359260, 1402825    
Attachments:
Description Flags
the actual result none

Description wangleziji 2015-10-26 03:58:49 UTC
Description of problem:
when the disk size is 1073741823 blocks(about 1T), the sfdisk -s can't list the disk size

Version-Release number of selected component (if applicable):
sfdisk (util-linux-ng 2.17.2)

How reproducible:
every time

Steps to Reproduce:
1.create a system with the disk size 1099511626752 bytes(1073741823 blocks)
2.run "sfdisk -s"

Actual results:
#sfdisk -s
/dev/mapper/vg_sunch07test-LogVol00:  20475904
total: 20475904 blocks

Expected results:
# sfdisk -s
/dev/sda:  1073741823
/dev/mapper/vg_sunch07test-LogVol00:  20475904
total: 1094217727 blocks

Additional info:
From the sfdisk.c source code, we can see when the disk size is 1073741823, it will return immediately. But "sfdisk -s /dev/sda" can works well.
 /* a CDROM drive without mounted CD yields MAXINT */
2819     if (silent && size == ((1<<30)-1))
2820       return;

Comment 2 wangleziji 2015-10-26 04:04:27 UTC
Created attachment 1086374 [details]
the actual result

Comment 3 Karel Zak 2015-10-27 10:28:43 UTC
It really seems like crazy heuristic. Thanks for your report.

Comment 4 wangleziji 2015-11-09 03:43:55 UTC
Is there any update for this issue? Thanks.

Comment 5 Karel Zak 2015-11-09 08:25:40 UTC
wangleziji, bugzilla is not the right place where you can ask 
for official RHEL support. Please, use support.redhat.com. I cannot promise any schedule for this bug. Thanks.

Comment 12 errata-xmlrpc 2017-03-21 11:26:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0747.html