Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SMART(8)		    System Manager's Manual		      SMART(8)

NAME
       smart, diskhealth -- retrieve health / SMART data from a	device

SYNOPSIS
       smart   [-dhitvx]   [-a	page:attribute[,page:attribute]...]  [--debug]
	     device
       diskhealth [-Dhitvx] [-a	page:attribute[,page:attribute]...]  [--debug]
	     device

DESCRIPTION
       The  smart  command  allows the user to monitor the various information
       reported	by Self-Monitoring, Analysis and Reporting Technology  (SMART)
       present	on most	ATA, SCSI, and NVMe storage media.  Because the	struc-
       ture of this information	varies across protocols, smart normalizes  en-
       tries using the format:

	       <Page ID>    <Attribute ID>    <Value>	 <Thresholds>

       Fields are tab-delimited	by default, but	the command can	output data in
       any format supported by libxo(3).

       Because	ATA  does  not	have log pages,	smart uses the Command Feature
       field value in place of the log page ID.	 For  SMART  READ  DATA,  this
       value  is 208 / 0xd0.  Note that	devices	choose which attribute ID val-
       ues they	support, their descriptions, and the format of the data.   The
       three values displayed with the --threshold option are:

	     -	 Status	flags (byte offset 1, 2	bytes)
	     -	 Nominal attribute value (byte offset 3, 1 byte)
	     -	 Worst Ever attribute value (byte offset 4, 1 byte)

       Additionally, smart reports the value of	the SMART STATUS command (Com-
       mand  Feature field value 218 / 0xda).  As this command does not	return
       any data, the command represents	this entry with	a synthetic  attribute
       ID  of  0,  and	it  uses  the command status (0	or 1) as the attribute
       value.

       NVMe devices support the	SMART/Health log page (Page ID 2 / 0x2).   The
       data returned in	this log page is not structured	as attribute IDs.  In-
       stead,  smart  uses  the	byte offset of each field as the attribute ID.
       For example, byte 3 is the Available Spare.  Thus, for NVMe,  attribute
       ID  3  is Available Spare.  Note	that NVMe health data does not include
       threshold values,  and  as  a  result,  the  command  will  ignore  the
       --threshold option.

       SCSI  devices  can  support  a  number  of log pages which report drive
       health.	The command will report	the following pages:

	     -	 Write Errors (Page ID 2 / 0x2)
	     -	 Read Errors (Page ID 3	/ 0x3)
	     -	 Verify	Errors (Page ID	5 / 0x5)
	     -	 Non-medium Errors (Page ID 6 /	0x6)
	     -	 Last N	Errors (Page ID	7 / 0x7)
	     -	 Temperature (Page ID 13 / 0xd)
	     -	 Start-stop Cycles (Page ID 14 / 0x3)
	     -	 Informational Exceptions (Page	ID 47 /	0x2f)

       Note that all log pages are optional, and a particular  drive  may  not
       support	all  these  pages.  For	SCSI devices, the Attribute ID maps to
       the SCSI	parameter code defined by the command.	 Parameter  codes  are
       integer	values	from 0 to N, and, by themselves, are ambiguous outside
       the context of a	particular log page.  Note that	SCSI health data  does
       not  include threshold values, and as a result, the command will	ignore
       the --threshold option.

       The following options are available:

       -a page:attribute, --attribute=page:attribute
		    A comma-separated list of attributes to display.  If  page
		    is missing,	display	the matching attribute from any	page.

       -d, --decode
		    Decode  the	attribute ID values.  This is the default when
		    invoked as diskhealth.

       -D, --no-decode
		    Do not decode the attribute	ID values.  This  is  the  de-
		    fault when invoked as smart.

       -h, --help   Prints a usage message and exits.

       -i, --info   Print general device information.

       -t, --threshold
		    Also print the threshold values.

       -v, --version
		    Print the version and copyright.

       -x, --hex    Print the values in	hexadecimal.

       device	    An explicit	device path ( /dev/ada0	) or GEOM provider (
		    ada0 ).

EXIT STATUS
       The smart utility exits 0 on success, and >0 if an error	occurs.

EXAMPLES
	     # smart -t	ada0

       Print all SMART READ DATA and SMART STATUS including the	threshold val-
       ues for ATA drive ada0.

	     # smart -a	5 ada0

       Print  only  attribute ID 5 ("Reallocated Sectors Count") for ATA drive
       ada0.

	     # smart -a	5,171 ada0

       Print attribute IDs 5 ("Reallocated Sectors Count") and 171 ("SSD  Pro-
       gram Fail") for ATA drive ada0.

	     # smart da0

       Print all health	pages supported	by SCSI	device da0 including:
	     -	 Write Errors
	     -	 Read Errors
	     -	 Verify	Errors
	     -	 Non-medium Errors
	     -	 Last N	Errors
	     -	 Temperature
	     -	 Start-stop Cycles
	     -	 Informational Exceptions

	     # smart -x	nda0

       Print all Health	log page entries in hexadecimal	for NVMe device	nda0.

DIAGNOSTICS
       The command may fail for	one of the following reasons:

       No output displayed  The	device does not	support	health data.

       CAMGETPASSTHRU  ioctl  failed   smart relies on cam(4) to retrieve data
       from devices and	will display this message if the device	does not  have
       a passthrough driver.  This can happen, for example, if the system uses
       the nvd(4) NVMe driver instead of the nda(4) driver.

SEE ALSO
       libxo(3), cam(4), nda(4), nvd(4)

AUTHORS
       This manual page	was written by Chuck Tuffli <chuck@FreeBSD.org>.

BUGS
       Probably.

FreeBSD	ports 15.quarterly     February	14, 2026		      SMART(8)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=smart&sektion=8&manpath=FreeBSD+Ports+15.1.quarterly>

home | help