Bug 177457 - diskinfo(8): diskinfo -v shows inacurate drive size
Summary: diskinfo(8): diskinfo -v shows inacurate drive size
Status: Open
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-29 01:00 UTC by Ronald F. Guilmette
Modified: 2018-04-10 23:01 UTC (History)
2 users (show)

See Also:


Attachments
smime.p7s (3.67 KB, application/pkcs7-signature)
2013-06-24 17:42 UTC, Jason Unovitch
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ronald F. Guilmette 2013-03-29 01:00:00 UTC
Apparently, under various conditions, diskinfo -v will show a size for
the specified drive which is smaller than the actual physical drive size,
as indicated by S.M.A.R.T. information (which can be queried using smartctl,
part of the smartmontools port).

This behavior on the part of diskinfo may perhaps be attributable to the
presence of either a Host Protected Area (HPA) and/or a Device Configuration
Overlay (DCO), or perhaps even by the interposition, between the physical
drive and the host, of certain brands and models of STAT/USB protocol
adapters/converters.

Although I personally am not sure of the specific conditions that may
give rise to these anomolies in the drive size, as reported by diskinfo,
I _am_ completely sure that the man page for diskinfo really should
include detailed information on the actual source of the drive size
information that it displays.  Unfortunately, at present it does not,
leaving the subject entirely open to speculation.

This should be corrected.  The diskinfo man page should be enhanced to
include information about the source of the drive size information and
the various factors that might possibly cause the drive size, as reported
by diskinfo, to differ from that reported by smartctl.

Fix: 

I really don't know what the proper fix is.  Either the author or the
source code of diskinfo should be consulted to try to find out the source
of the drive size information that diskinfo reports.
How-To-Repeat: 
man 8 diskinfo
Comment 1 Jason Unovitch freebsd_committer 2013-06-24 17:42:39 UTC
Isn't this the classic case of the OS using a base of 1024 to calculate 
size and the hard drive manufacturer using 1000 for the same purpose?  
My "3TB" Western Digital Drives show 3.0 TB using smartctl -a and 2.7 TB 
using diskinfo -v.  I get the same 2.7 TB when I manually divide the 
media size in bytes by 1024 four separate times.

Respectfully,
Jason Unovitch
Comment 2 Ronald F. Guilmette 2013-06-24 22:05:07 UTC
In message <51C876FF.4030302@gmail.com>, you wrote:

>Isn't this the classic case of the OS using a base of 1024 to calculate
>size and the hard drive manufacturer using 1000 for the same purpose?

I do not believe so, no.

It has been awhile since I filed this PR, but I believe that the
non-matching numbers I was looking at were sector counts... NOT
byte counts.

The number of sectors on a drive is the number of sectors on that drive.
It should not be different between different tools one might use to
look at that number.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:01 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped