openSeaChest_SMART.txt                                    Revision: 21-Apr-2020
===============================================================================
 openSeaChest_SMART for Linux and Windows - Seagate drive utilities
 Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates
 See Version History below.
===============================================================================
Welcome to the openSeaChest open source project!

This collection of storage device utility software is branched (forked) off of
an original utility collection called the Seagate SeaChest Utilities by Seagate
Technology LLC.  The original SeaChest Utilities are still available at
www.seagate.com or https://github.com/Seagate/ToolBin/tree/master/SeaChest.
Binary versions are available for Linux or Windows, with the Windows versions
signed by Seagate Technology LLC.

BINARIES and SOURCE CODE files of the openSeaChest open source project have
been made available to you under the Mozilla Public License 2.0 (MPL).  The
openSeaChest project repository is maintained at
https://github.com/Seagate/openSeaChest.

openSeaChest is a comprehensive, easy-to-use command line diagnostic tool that
helps you quickly determine the health and status of your storage product. It
includes several tests that will examine the physical media on your storage
device.

Many tests and commands are completely data safe, while others will change the
drive (like firmware download or data erasure or setting the maximum capacity,
etc).  Be careful using openSeaChest because some of the features, like the
data erasure options, will cause data loss.   Some commands, like setting the
maximum LBA, may cause existing data on the drive to become inaccessible.  Some
commands, like disabling the read look ahead buffer, may affect the performance
of the drive.  Seagate is not responsible for lost user data.

openSeaChest diagnostics are command line utilities which are available for
expert users.  These command line tools assume the user is knowledgeable about
running software from the operating system command prompt. CLI tools are in the
English language only and use "command line arguments" to define the various
tasks and specific devices.  openSeaChest diagnostics are available for both
Linux and Windows environments.

Disk drives are constantly monitoring and analyzing their own performance,
integrity and environment.  The current state of this technology is the result
of more than 20 years of innovative Seagate engineering focused on self-testing.

With the backing of personal computer manufacturers, the disk drive industry
adopted an analysis system in the 1990's called Self Monitoring Analysis and
Reporting Technology, or SMART. The idea then and today is to predict a failure
before it happens. Various attributes are being monitored and measured against
certain threshold limits. If any one attribute exceeds a threshold then a
general SATA SMART Status test will change from Pass to Fail.

Many computers automatically check SMART Status when they start up which is
when most people become aware of the issue. If still under warranty, then SMART
Status FAIL is a valid condition for warranty replacement.

You can use openSeaChest_SMART software with --smartCheck to test the SATA SMART
status of the drive.

When a SMART Status test has a FAIL it is extremely important that you back up
all of your important data. SMART Status FAIL is a near-term prediction of
drive failure and the drive usually functions like normal. Unfortunately, there
is no way to specifically predict when the failure will occur, so your best
response is to back up your data as soon as possible.

openSeaChest does not interpret attributes or thresholds.  As a practical
matter, the technology supporting SMART is constantly being improved.  Each new
design incorporates improvements that increase the accuracy of the SMART
prediction. As a matter of policy, Seagate does not publish attributes and
thresholds. Seagate Support does not help to analyze SMART attributes.

In addition, the SMART command set includes short and long Drive Self Test
(Offline Immediate).

Seagate drives employ a background media scan (BGMS) during idle activity
times.  The BGMS is a sequential read of sectors from the beginning to the end
the of the drive.  If BGMS is interrupted it later restarts where it left off.
BGMS has no effect on performance.  BGMS collects information about
"suspicious" sectors.  When the Short DST is run the first step is a review of
these "suspicious" sectors.  It is possible for Short DST to fail quickly if
one of these BGMS sectors is unreadable.

It may be possible to repair a problem when Short DST fails due to failure to
read a particular sector (LBA).  You might consider the -dstAndClean command
line option.  See the sections below "Sector Repair Commands" and "Bad LBA
(Sector) Found" for more information on this subject.

If you wish to test the drive for physical integrity, please use Short Drive
Self Test (--shortDST).  Because the BGMS has continuously collected
information on the entire drive, Short DST is effectively testing the entire
drive.

This User Guide file contains important information about openSeaChest SMART.
Please read this entire file before using this software.

Note: One gigabyte, or GB, equals one billion bytes when referring to hard
drive capacity. This software may use information provided by the operating
system to display capacity and volume size. The Windows file system uses a
binary calculation for gibibyte or GiB (2^30) which causes the abbreviated size
to appear smaller. The total number of bytes on a disk drive divided by the
decimal calculation for gigabyte or GB (10^9) shows the expected abbreviated
size. See this FAQ for more information
<http://knowledge.seagate.com/articles/en_US/FAQ/172191en?language=en_US>.

If this is your drive, you should always keep a current backup of your
important data.

Usage - Linux (run with sudo)
=============================
        openSeaChest_SMART [-d <sg_device>] {arguments} {options}

Examples - Linux
================
        sudo openSeaChest_SMART --scan
        sudo openSeaChest_SMART -d /dev/sg2 -i
        sudo openSeaChest_SMART -d /dev/sg1 --shortDST --poll

Usage - Windows (run as administrator)
======================================
        openSeaChest_SMART [-d <device>] {arguments} {options}

Examples - Windows
==================
        openSeaChest_SMART --scan
        openSeaChest_SMART -d PD0 -i
        openSeaChest_SMART -d PD1 --shortDST --poll

Utility Arguments
=================
        -s, --scan
                Scan the system and list all storage devices with logical
                /dev/sg? assignments. Shows model, serial and firmware
                numbers. If your device is not listed on a scan immediately
                after booting, then wait 10 seconds and run it again.

        -S, --Scan   (note the capital letter S)
                This option is the same as --scan or -s, however it will also
                perform a low level rescan to pick up other devices. This
                low-level rescan may wake devices from low power states and may
                cause the OS to re-enumerate them. Use this diagnostic option
                when a device is plugged in and not discovered in a normal scan.

                NOTE: A low-level rescan may not be available on all interfaces
                or all OSs.  The low-level rescan is not guaranteed to find
                additional devices in the system when the device is unable to
                come to a ready state.

        -F, --scanFlags [option list]
                Use this option with -s to control the output from scan with the
                options listed below. Multiple options can be combined.
                     ata            - show only ATA (SATA) devices
                     usb            - show only USB devices
                     scsi           - show only SCSI (SAS)) devices
                     nvme           - show only NVMe devices
                     interfaceATA   - show devices on an ATA interface
                     interfaceUSB   - show devices on a USB interface
                     interfaceSCSI  - show devices on a SCSI or SAS interface
                     interfaceNVME  - show devices on a NVMe interface
                    Linux:
                     sd             - show /dev/sd? device handles
                     sgtosd         - show the sd and sg device handle mapping
                    Windows:
                     ignoreCSMI     - do not scan for any CSMI devices
                     allowDuplicates - allow drives with both CSMI and PD
                                       handles to show up multiple times in the
                                       list.

                Examples of combining two options:
                     -s --scanFlags usb scsi  - show only USB and SAS devices
                     --scan -F ata interfaceSCSI  - show only SATA nearline
                        drives on a SAS adapter

        -d, --device <device handle>
                Use this option with all commands, except --scan, to specify
                the sg device handle (target drive) on which to perform an
                operation. See the section below 'Tool Usage Hints' for
                information about defining multiple device handles.

                Example Lin: -d /dev/sg5
                Example Win: -d PD0, or -d PD3

        -i, --deviceInfo
                Show information and features for the storage device. USB
                devices will show the product name, serial and firmware numbers
                as communicated by the USB-SATA bridge.  Add --usbChildInfo
                to display details about the drive within the USB enclosure.

        --SATInfo                       (SATA only)
                Displays SATA device information on any interface using both
                SCSI Inquiry/VPD/Log reported data (translated according to
                SAT) and the ATA Identify/Log reported data.

        --testUnitReady
                A simple check to see if the device responds to commands from
                interface.  Ready or Not Ready are the outputs.  Not Ready
                results will also include the full SCSI Sense Code.

        --poll
                Use this option to cause another operation to poll for progress
                until it has completed.  This argument does not return to the
                command prompt and prints ongoing completion percentages (%)
                and the final test result.  Full drive procedures will take a
                very long time.  Used with --shortDST and --longDST.

        --shortDST
                Execute a short diagnostic drive self test. This test can take
                up to 2 minutes to complete.  Use with the --poll argument to
                let openSeaChest check for progress and print it to the screen
                until complete.  If the --poll argument is not used then the
                test begins and immediately returns to the command prompt.  Use
                the --progress DST command to check on the completion
                percentage (%) and test result. The poll argument does not
                return to the command prompt and prints ongoing completion
                percentages (%) until the final test result.

                Note: Use --progress DST or --showDSTLog to see details about
                the last DST run on the drive.

        --longDST
                Execute a long diagnostic drive self test. This test takes
                hours to finish. A 2TB drive may take six (6) hours to
                complete. The start argument begins the test and immediately
                returns to the command prompt.  Use the --progress DST command
                to check on the completion percentage (%) and test result. The
                poll argument does not return to the command prompt and prints
                ongoing completion percentages (%) and the final test result.

                This test stops on the first error. Use --abortDST to manually
                stop the test. SAS drives give status in 1% increments. SATA
                drives give status in 10% increments which means more than an
                hour may elapse between updates on a SATA drive >2TB.

                Because of the extreme length of time required to run the Long
                DST command on a large disk drive an additional command line
                argument is required as confirmation of your understanding that
                the test will take a very long time to complete.

                Note: The SeaChest --deviceInfo command output has a line
                similar to this example: 'Long Drive Self Test Time:  1 hour 38
                minutes'.

                If the --longDST poll option is running and you want to abort
                the test then you will need to open a second terminal window
                and run the --abortDST command.  Otherwise, it is safe to
                restart the system while long DST is running which also ends the
                test.

        --progress DST
                Get the periodic ongoing progress for certain types of tests
                which were started quietly (default) and running in the
                background until completion and the tool has already returned
                to the command prompt.  This type of progress checking is used
                when not using the --poll argument which does not return to the
                command prompt.  The progress counts up from 0% to 100%.
                Specify the type of test to check progress.

        --abortDST
                Abort a diagnostic Drive Self Test that is in progress.

        --smartCheck
                Perform a SMART check on a device to see if any internal
                thresholds have been tripped or if the drive is still operating
                within specification.

        --idd [short | long]    (Seagate Only)
                Start an In Drive Diagnostic (IDD) test on a Seagate SATA
                drive. Not all tests are supported by all products. If a
                selected test is not supported, the utility will return
                an error code meaning "not supported".

                short:   Reset and Recalibration test. Be careful running this
                         test on the boot device.
                long:   Test G list and P list for readability.
                repair:  Reset and Recalibration test and test G list and
                         P list and attempt to repair or reallocate bad
                         sectors.

                Add --poll to the command line to see periodic status during
                the test.  Otherwise, use --progress DST after 60 seconds to
                allow the drive time to spin back up after the recalibration
                test.

                Example: --idd short --poll

        --abortIDD (Seagate Only)
                Abort a Seagate In Drive Diagnostic (IDD) that is in progress.

        --errorLimit [limit in number of physical LBAs | none]
                Use this option to specify a different error limit for a user
                generic or long generic read test. This must be a number of
                logical LBAs to have errors. If a drive has multiple logical
                sectors per physical sector, this number will be adjusted for
                you to reflect the drive architecture. (The default error limit
                is 50 x number of logical sectors per physical sector.) The
                predefined text string "none" (without quotes) may be entered
                to indicate that there is no error limit.

                Caution: You should closely monitor your system if using the
                "none" argument because some failure modes, like a bad cable,
                might see every sector as defective. Storage devices are
                defined with billions of physical sectors and if you are
                capturing a log without an error limit, then it would quickly
                grow to fill up all available capacity on the capture device.

        SATA Only:
        =========
        --conveyanceDST (SATA Only)
                Execute a conveyance diagnostic drive self test. A conveyance
                test can be used to check if a drive has incurred handling
                damage. This test can take up to 2 minutes to complete. Use the
                --poll argument to make this operation poll for progress until
                complete. Use the --progress dst command to check on the
                completion percentage (%) and test result.

        --captive or --foreground (SATA Only)
                Use this option to run a DST operation in captive/foreground
                mode. This mode may allow a device to test more of itself and
                may be slightly faster than offline/background mode since it
                does not need to service additional command during the test.
                When using this mode, the utility must wait the entire time for
                the DST or IDD to complete and progress cannot be indicated
                during this time.

        --showDSTLog (SATA Only)
                This option will show the entries in the DST log. Up to 21
                entries may be shown (pending drive support) and will be shown
                with the most recent entry first.

        --smartInfo (SATA Only)
                This option will show SMART information reported by a given
                device.

        --smartFeature [enable | disable]            (SATA Only) (Seagate Only)
                Use this option to enable or disable the SMART feature on a
                SATA drive.  When disabled, the entire SMART feature set, minus
                the enable command, is turned off.  This includes all SMART
                logging, attributes, SMART trip ability, and DST ability.
                Note: This command is declared obsolete in ACS4.

        --smartAttributes [raw | analyzed]           (SATA Only)
                The drive will display its list of supported SMART attributes.
                Some attributes names are commonly standard and most others are
                vendor unique. In either case, the attribute thresholds are
                always vendor unique. Most attributes are informational and not
                used to determine a warranty return. Use the --smartCheck
                command to determine if one of the warranty attributes has been
                tripped. Seagate Support does not help to analyze SMART
                attributes.

        --smartAttributeAutosave [enable | disable]  (SATA Only) (Seagate Only)
                Use this option to enable or disable SMART attribute auto-save
                on an ATA drive.  This is the drive's ability to update the
                attributes on it's own without the "update attributes" command.
                By default, this is enabled and on new drives may just be a
                no-op.
                Note: This command is declared obsolete in ACS4.

        --smartAutoOffline [enable | disable]  (SATA Only) (Seagate Only)
                Use this option to enable or disable SMART auto-offline feature
                on an ATA drive.  This command was never officially adopted by
                ATA committee, but was in the original SMART spec from
                Compaq/HP. This allows the drive to do an offline scan on it's
                own. This is not quite a background media scan (BGMS described
                above), nor is it the same as a DST. It's a drive scan that
                will go check itself for issues and update attributes. Uncommon
                and not supported on most drives.

        --showSMARTErrorLog [ summary | comprehensive ] (SATA Only)
                This option will display the ATA SMART Error log on the screen.
                Use "summary" to view the summary SMART error log (last 5
                entries). Use "comprehensive" to view all the entires the drive
                has available. Specifying "comprehensive" will automatically
                pull the ext error log on drives that support 48bit LBAs.

                Note: The summary error log will truncate 48bit commands, so
                some information will be missing to describe the operation of
                certain commands.

        --smartErrorLogFormat [ raw | detailed ]        (SATA Only)
                Use this option to change the format of the output from the
                --showSMARTErrorLog option. The default mode is "detailed".

SAS Only:
                --setMRIE [ default | 0 - 6 ]  (SAS Only)
                Use this option to change the MRIE mode on the informational
                exceptions mode page.
                    default - set to the drive default
                    0 - Disable exception reporting
                    1 - Asynchronous reporting (obsolete)
                    2 - Establish unit attention condition
                    3 - Conditionally generate recovered error
                    4 - Unconditionally generate recovered error
                    5 - Generate no sense
                    6 - Report on request

        --showSCSIDefects [ p | g | pg ]        (SAS Only)
                This option will display the SCSI defects on the screen. The
                arguments to this will tell whether to get the grown, primary,
                or primary and grown defects from the drive. Use the
                --defectFormat option to specify the mode to display the
                defects. If no mode is specified, physical cylinder-head-sector
                mode is assumed.

                Arguments:
                p - use this option to pull and display the primary (factory)
                    defects
                g - use this option to pull and display the grown (reallocated)
                    defects
                pg - the options can be combined to pull and display both
                    defect lists.

        --defectFormat [ # | shortBlock | longBlock | xbfi | xchs | bfi | chs ] (SAS Only)
                This option set the format of the defects to output. Not all
                drives will support all defect modes. SSDs will only support
                block modes.

                Arguments: show the defects in either name or # mode
                shortBlock | 0    short block address mode (drives < 32bit LBA)
                xbfi       | 1    extended bytes from index mode
                xchs       | 2    extended physical cylinder-head-sector mode
                longBlock  | 3    long block address mode (drives > 32bit LBA)
                bfi        | 4    bytes from index mode
                chs        | 5    physical cylinder-head-sector mode

                Examples: --defectFormat 3, or --defectFormat longBlock

Utility Options
===============
        -h, --help
                Show utility options and example usage (this output you see now)

        -v [0-4], --verbose [0 | 1 | 2 | 3 | 4]
                Show verbose information. Verbosity levels are
                0 - quiet
                1 - default
                2 - command descriptions
                3 - command descriptions and values
                4 - command descriptions, values, and data buffers.

                Example: -v 3 or --verbose 3

        -q, --quiet
                Run openSeaChest in quiet mode. This is the same as -v0
                or --verbose 0

        -V, --version
                Show openSeaChest version and copyright information & exit

        --license
                Display the Seagate End User License Agreement (EULA).

        --echoCommandLine
                Shows the command line above the banner in the standard output.
                Useful when saving output to logs.

        --enableLegacyUSBPassthrough
                Only use this option on old USB or IEEE1394 (Firewire) products
                that do not otherwise work with the tool. This option will
                enable a trial and error method that attempts sending various
                ATA Identify commands through vendor specific means. Because of
                this, certain products may respond in unintended ways since
                they may interpret these commands differently than the bridge
                chip the command was designed for.

        --sat12byte
                This forces the lower layer code to issue SAT spec ATA
                Pass-through 12-byte commands when possible instead of 16-byte
                commands.  By default, 16-byte commands are always used for ATA
                Pass-through.  USB products may need this option as a
                workaround if the default does not perform.

        --onlySeagate
                Use this option to match only Seagate drives for the options
                provided. May also be used with the --scan command.

        --modelMatch [model Number]
                Use this option to run on all drives matching the provided
                model number. This option will provide a closest match although
                an exact match is preferred. Ex: ST500 will match ST500LM0001.
                The option --childModelMatch may be used to match drives in USB
                enclosures.

                Note: See the section below 'Tool Usage Hints' for information
                about defining multiple device handles.

        --onlyFW [firmware revision]
                Use this option to run on all drives matching the provided
                firmware revision. This option will only do an exact match.
                The option --childOnlyFW may be used to match drives in USB
                enclosures.

         --noTimeLimit
                Use with utility command arguments which have build in timeout
                values. For example, --shortDST has a 10 minutes default
                timeout.  In some cases a good drive may need more time to
                complete the test due to other legitimate system activity.

        --forceATA
                Using this option will force the current drive to be treated as
                a ATA drive. Only ATA commands will be used to talk to the
                drive.

        --forceATADMA   (SATA Only)
                Using this option will force the tool to issue SAT commands to
                ATA device using the protocol set to DMA whenever possible (on
                DMA commands). This option can be combined with --forceATA.

        --forceATAPIO   (SATA Only)
                Using this option will force the tool to issue PIO commands to
                ATA device when possible. This option can be combined with
                --forceATA.

        --forceATAUDMA  (SATA Only)
                Using this option will force the tool to issue SAT commands to
                ATA device using the protocol set to UDMA whenever possible (on
                DMA commands). This option can be combined with --forceATA.

        --forceSCSI
                Using this option will force the current drive to be treated as
                a SCSI drive. Only SCSI commands will be used to talk to the
                drive.

        Windows only:
        --csmiIgnorePort
                Use this option to force setting the "ignore Port" flag for the
                port identifier in a CSMI passthrough command. This option can
                be combined with --csmiUsePort which will force the passthrough
                to rely on only the SAS address. This flag is intended to help
                troubleshoot or improve CSMI compatibility on systems that are
                otherwise not functional.

        --csmiUsePort
                Use this option to force setting the "Use Port" flag for the
                PHY identifier in a CSMI passthrough command. This option can
                be combined with --csmiIgnorePort which will force the
                passthrough to rely on only the SAS address. This flag is
                intended to help troubleshoot or improve CSMI compatibility on
                systems that are otherwise not functional.

        --csmiVerbose
                Use this option to show some verbose output when running the
                tool on a CSMI handle. The debugging information shown will be
                specific to the CSMI passthrough mechanism and may be useful
                when troubleshooting system/driver compatibility issues.

Sector Repair Commands
======================
Data destructive commands will require additional command line arguments as
confirmation of your understanding that data will be lost on the drive.
Seagate is not responsible for lost user data.

        --confirm I-understand-this-command-may-erase ... etc

        --dstAndClean
                Runs DST, then checks for an error and repairs the error if
                possible. This continues until all errors reported by DST are
                fixed, or when the error limit is reached. The default limit is
                50 errors.  See --errorLimit to change limit.

See the section below "Bad LBA (Sector) Found" for more information on this
subject.

Return codes
============
        0       No Error Found
        1       Error in command line options
        2       Invalid Device Handle or Missing Device Handle
        3       Operation Failure
        4       Operation not supported
        5       Operation Aborted
        6       File Path Not Found
        7       Cannot Open File
        8       File Already Exists
        9       Need Elevated Privileges (sudo, run as administrator)
        Anything else = unknown error

================
Tool Usage Hints
================
See Sample Output examples below.

First, run the openSeaChest -s option to determine what /dev/sg? or PD? device
handle assignment lines up to your disk drive. This option will also show you
other details about the drive including the current firmware revision.

Linux:
Vendor     Handle       Model Number       Serial Number     FwRev
ATA        /dev/sg0     ST94813AS          3AA043KP          3.03
SEAGATE    /dev/sg1     ST1000NM0011       ZAA15VAS          SN03

Windows:
Vendor     Handle   Model Number        Serial Number     FwRev
IDE        PD0      ST94813AS           3AA043KP          3.03
SEAGATE    PD1      ST1000NM0011        ZAA15VAS          SN03

You can use SeaChest -s --onlySeagate to limit the display to just Seagate.

All utility arguments will require you to identify the specific drive by
providing the sg or PD device handle (-d, --device).

Lin example, openSeaChest_Basics -d /dev/sg1 --shortDST poll
Win example, openSeaChest_Basics -d PD2 --shortDST poll

You may combine multiple tests with a single command line.  For example,
inLinux, openSeaChest_Basics -d /dev/sg0 -i --smartCheck runs both identify and
SMART.  In Windows, openSeaChest_Basics -d PD0 -i --smartCheck runs both
identify and SMART.

Multiple device handles can be given by adding -d /dev/sg# for each additional
handle.  Devices are processed in sequential order.  For example, in Linux,
openSeaChest_Basics -d /dev/sg0 -d /dev/sg3 -i runs identify on these two
devices.  In Windows, openSeaChest_Basics -d PD0 -d PD3 -i runs identify on
these two devices.

Caution: All device handles may be specified.  However, great care should be
taken to fully anticipate the consequences of running a command on all storage
devices in a system.  For example, a command to erase data on all drives could
be catastrophic or exactly what you want. The shortcut to select all devices is
-d all.  Seagate is not responsible for lost user data.  Along with the
designation for all devices, you can narrow the tasks to specific types of
drives by using the --onlySeagate, --modelMatch and --onlyFW filters.

If the task is an OFFLINE command like format unit or short DST, meaning that
the drive works on the task in the background and the tool quickly returns to
the command prompt (there is little or no I/O to the system), then you can
expect the system to run normally. If the task has high I/O to the system like
a sequential read of all sectors on the drive, then you can expect the system
to slow down with each additional device.

The discussion above is about starting SEQUENTIAL tests, or one after the
other.  When the task does not return to the command prompt for a very long
time, then you have a few options to run tests in PARALLEL, also called
simultaneous, in other words all at the same time.  One way is to start
different drives in different Terminal windows, if available.  There are other
more sophisticated methods using parallel processing, for information about
these methods please see the information at this link:
https://github.com/Seagate/ToolBin/tree/master/SeaChest/parallel_testing

Tests which take a very long time to complete or erase all user data on the
drive will require a longer command line argument than indicated in the --help
output to the screen.  This approach is taken to eliminate the possibility of
accidental data loss or the commitment of long test times. The longer command
arguments are similar to -I-understand-this-command-will-take-a-long-time or
-I-understand-this-command-will-erase-all-data.

Advanced SAS installations may use dual ports.  These are listed as Port 0 and
Port 1 on the device information report. When both ports are active, each one
may have a unique /dev/sg designation.  The scan option may indicate that there
are two drives in the system with the same serial number.  Dual port
installations will also report two different Worldwide Numbers (WWN).

======================
Bad LBA (Sector) Found
======================
IMPORTANT: Please read and carefully consider all of the following information
about your "Bad LBA (Logical Block Address, or Sector) Found" options.

A bad sector is a small 512-byte area on the disk drive that is reporting
errors and cannot be accessed properly. New bad sectors, sometimes called grown
defects, are often caused by some kind of physical damage. If a file or folder
uses this sector, then the file is already incomplete or corrupt because the
bytes are not readable.

**** NOTE **** The following information applies only to Seagate Technology,
Maxtor, Samsung and LaCie brand disk drives:

When openSeaChest discovers a bad LBA (sector) through reading, it displays a count
of the bad sectors.

Sectors are often not in use. If a sector is in use, then that file is
incomplete or corrupt. When a bad sector happens to align with a folder or
directory listing structure, then the links to files and sub-folders it manages
may be broken.

You should carefully consider the importance of your data. While the sector is
currently unreadable, if the file or folder is important to you then you may
need professional recovery services to possibly reclaim the data. In this case,
select to scan without trying to repair sectors on the drive.

If you have decided that the file or folder is replaceable, already backed up
or just not important to you, then you can tell openSeaChest to attempt to attempt
to repair the sector.  See the Sector Repair Commands section above.

By design, modern disk drives maintain spare sectors for reallocation purposes.
Usually, sectors become difficult to read long before they become impossible to
read. In this situation the actual data bytes in the sector are preserved and
transferred to the new spare during a sector reallocation. Similarly, when a
disk drive writes data and encounters a problem, the drive firmware retires the
problem sector and activates a replacement before giving successful write
status.

If you give permission to attempt to repair a bad sector, then openSeaChest will
attempt to write a 512-byte pattern of zeros to that single error sector.
Usually, this action will assist the disk drive firmware in managing the
problem by retiring the problem sector and activating a spare in its place. If
the attempted repair fails to reallocate the LBA to an available spare, then
the test is a FAIL and the drive is bad.

Note: Seagate Technology is not responsible for lost user data.

Windows Only Usage
==================
All Windows version tools support finding CSMI devices and talking to them like
you would a normal device.  The scan output will show all drives it detects
ONCE. CSMI device handles have a structure like SCSI0:1.  If a drive has both a
PD? and SCSI?:? handle, then openSeaChest will show the PD handle instead of the
SCSI (CSMI) handle.

When drives are in a RAID, the PD device handle is usually not available and
the CSMI handle may provide an alternate way to talk to the drive.  Just
because a device has a CSMI handle doesn't mean it is part of a RAID.

If you want to see both handles, add --scanFlags allowDuplicates to the command
line.  If you don't want to see any CSMI devices, add --scanFlags ignoreCSMI to
the command line.  SeaChest_Info -d SCSI?:? --csmiInfo is useful when
troubleshooting CSMI device handles questions.

=========================
Linux General Usage Hints
=========================
Remember that Linux file names and command line arguments are cAsE SeNsiTiVe.

Display a file listing with the Linux command: ls -lah

The tool will require root privileges to run using either sudo or su commands.
Also, verify that the tool has executable rights.

A dot slash is a dot followed immediately by a forward slash (./). It is used
in Linux to execute a compiled program in the current directory when it is not
a built-in command or found in your path.

For example, ./openSeaChest -d /dev/sg0 --shortDST poll
or, sudo ./openSeaChest -d /dev/sg0 --shortDST poll

Shut down the files system and remove the power with the command:
poweroff

See previous screen history with the key combination:
Shift+PgUp or Shift+PgDn

Save a log file by redirecting the screen output to a text file by adding space
&>test.log at the end of your command line. Choose your own file name. To
append the screen output to an existing log file use >>test.log.

To save a log and display results at the conclusion of the tests, you can use
the "tee" command. Tee command writes to the STDOUT and to a file.
For example,
openSeaChest --echoCommandLine -d /dev/sg0 -i --smartCheck | tee -a mySeaChestLog.txt

Display a log or text file with the Linux "less" command: less myfile.log
Press the letter q to quit displaying the file.  Similarly, you can easily
read the Seagate License agreement by piping the output to the less
command with openSeaChest --license |less

Display a list of sg (SCSI generic) devices with the command:
cat /sys/class/scsi_generic/sg*/device/model
or
ls /dev/sg*

sg devices include the following interfaces: SATA, USB, SCSI (SCSI, SAS and FC)

Add the command word 'time' on the same command line before the openSeaChest
command to see how much time it takes to run a test.
For example, time ./openSeaChest -d /dev/sg0 --shortDST poll

When drives are not detected by openSeaChest
--------------------------------------------
The problem is that the sg driver isn't loaded on the system on boot.  You can
test if it is loaded by doing "ls /dev/sg*" and see if anything shows up. If
nothing shows up then the SG driver is missing (which is required by
openSeaChest to issue commands).

You need to do "modprobe sg" as root to load the sg module (since it wasn't
compiled into the kernel), then you will get sg devices that we can scan and
find. Once you run the modprobe command and sg is successfully loaded, then you
can re-run "ls /dev/sg*" and see SG device nodes. openSeaChest tools should
then be able to find devices once again.

How to control the amount of runtime kernel messages
----------------------------------------------------
When testing more drives than a system can hold, careful use of host adapters
and hot-plugging batches of drives (but never to direct motherboard
connections!) can help speed the process.  The Linux operating system will
display various system error messages, or none, when storage devices are
powered down and exchanged with the next drives.  The amount of information
contained in the OS error messages can be reviewed using the Linux utility
command "sysctl kernel.printk".  The default setting is defined by the
particular distro.  Tiny Core Linux, for example may set "4 4 1 7".  To hide
hot-plugging messages try "3 4 1 7", to increase the messaging to include
device details like model numbers try "6 4 1 7".  The command to set is 'sudo
sysctl -w kernel.printk="6 4 1 7"'.  See man sysctl - "configure kernel
parameters at runtime" for more.

Tesing storage devices on the USB and Thunderbolt interfaces
------------------------------------------------------------
Sometimes, when testing a storage device, it is more convenient to attach it as
an external drive to the test system. In the case of SATA drives there are very
many SATA-to-USB 'bridge' adapters available.  The quality and range of command
'passthrough' support for these adapters varies greatly.  Our tools will
attempt to work through these adapters.

If your notebook has a Thunderbolt interface connection then you may be able to
test a wide range of devices.  External Thunderbolt expansion systems provide a
PCIe slot in a chassis that can hold a SAS, NVMe, or SATA host adapter. The
host adapters would have cables that go out to your test bench where you would
provide the drive and an external power supply for the drives. Thunderbolt 2
expansion systems work in Linux by default. Thunderbolt 3 expansion systems
need to be enabled in the kernel with boot time options before it will be
recognized by the Linux operating system. See
https://www.kernel.org/doc/html/v4.14/admin-guide/thunderbolt.html for
information about how to activate the interface.

===========================
Windows General Usage Hints
===========================
The tool will require Administrative privileges to run.
Also, verify that the tool has executable rights.

Remember that the command line arguments are cAsE SeNsiTiVe.

Save a log file by redirecting the screen output to a text file by adding space
&>test.log at the end of your command line. Choose your own file name. To
append the screen output to an existing log file use >>test.log.

To save a log and display results at the conclusion of the tests, you can use
the powershell "tee" command. Tee command writes to the STDOUT and to a file.

For example:
powershell ".\openSeaChest --echoCommandLine -d PD1 --smartCheck | tee -append mySeaChestLog.txt"

Manual Launch for Windows
-------------------------
An individual openSeaChest utility for Windows cannot be launched by just
clicking on the file name. If started that way, the openSeaChest utility will
briefly show a black window box and quickly close.  That is what happens when
trying to run it from the Windows File Manager.

This is a command line tool and the requirement is to open a Command Prompt as
Administrator.  There are two easy ways to do this:
  1. Windows Accessories, right-click the Command Prompt icon and select Run as
     Administrator.
  2. Click Windows Start. In the Start Search box, type cmd, and then press
     CTRL+SHIFT+ENTER.

Then change drives or directory to where the openSeaChest utility is located and
run the tool file name from there.

=============
Sample Output
=============

SATA HDD Device Information:

Lin: sudo ./openSeaChest_Basics -i -d /dev/sg1
Win: openSeaChest_Basics -i -d PD1
===============================================================================
 openSeaChest - Seagate drive utilities
 Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates
===============================================================================
        Model Number: ST4000DX001-1CE168
        Serial Number: ZQ3034X7R
        Firmware Revision: CC44
        World Wide Name: 500Q0C5007A5FCF19
        Drive Capacity (TB/TiB): 4.00/3.64
        Native Drive Capacity (TB/TiB): 4.00/3.64
        Temperature Data:
                Current Temperature (C): 25
                Highest Temperature (C): 40
                Lowest Temperature (C): 18
        Humidity Data:
                Current Humidity (%): Not Reported
                Highest Humidity (%): Not Reported
                Lowest Humidity (%): Not Reported
        Power On Time:  4 days 1 hour
        Power On Hours: 97.00
        MaxLBA: 7814037167
        Native MaxLBA: 7814037167
        Logical Sector Size (B): 512
        Physical Sector Size (B): 4096
        Sector Alignment: 0
        Rotation Rate (RPM): 5900
        Form Factor (inch): 3.5
        Last DST information:
                Time since last DST (hours): 0.00
                DST Status/Result: 0x0
                DST Test run: 0x1
        Interface speed:
                Max Speed (Gb/s): 6.0
                Negotiated Speed (Gb/s): 6.0
        Annualized Workload Rate (TB/yr): 2.51
        Total Bytes Read (GB): 6.65
        Total Bytes Written (GB): 21.27
        Drive Reported Utilization (%): Not Reported
        Encryption Support: Not Supported
        Cache Size (MiB): 64.00
        Read Look-Ahead: Enabled
        Write Cache: Enabled
        SMART Status: Good
        ATA Security Information: Supported, Frozen
        Zoned Device Type: Not a Zoned Device
        Firmware Download Support: Immediate, Segmented
        Specifications Supported:
                ACS-2
                ATA8-ACS
                ATA/ATAPI-7
                ATA/ATAPI-6
                ATA/ATAPI-5
                ATA/ATAPI-4
                SATA 3.1
                SATA 3.0
                SATA 2.6
                SATA 2.5
                SATA II: Extensions
                SATA 1.0a
        Features Supported:
                NCQ
                HPA
                Power Management
                Security
                SMART
                DCO
                48bit Address
                APM
                GPL
                Free-fall Control
                Write-Read-Verify

SATA SSD Device Information:

Lin: sudo ./openSeaChest_Basics -i -d /dev/sg1
Win: openSeaChest_Basics -i -d PD1
===============================================================================
 openSeaChest - Seagate drive utilities
 Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates
===============================================================================
        Model Number: ST120FP0021
        Serial Number: PQ57011BD
        Firmware Revision: B770
        World Wide Name: 5000C501005A16633
        Drive Capacity (GB/GiB): 120.03/111.79
        Native Drive Capacity (GB/GiB): 120.03/111.79
        Temperature Data:
                Current Temperature (C): 26
                Highest Temperature (C): 0
                Lowest Temperature (C): 17
        Humidity Data:
                Current Humidity (%): Not Reported
                Highest Humidity (%): Not Reported
                Lowest Humidity (%): Not Reported
        Power On Time:  2 days 23 hours
        Power On Hours: 71.00
        MaxLBA: 234441647
        Native MaxLBA: 234441647
        Logical Sector Size (B): 512
        Physical Sector Size (B): 4096
        Sector Alignment: 0
        Rotation Rate (RPM): SSD
        Form Factor (inch): 2.5
        Last DST information:
                Not supported
        Interface speed:
                Max Speed (Gb/s): 6.0
                Negotiated Speed (Gb/s): 3.0
        Annualized Workload Rate (TB/yr): 299.80
        Total Bytes Read (TB): 2.35
        Total Bytes Written (GB): 90.19
        Drive Reported Utilization (%): Not Reported
        Encryption Support: Not Supported
        Cache Size (MiB): Not Reported
        Percentage Used Endurance Indicator (%): 1.00437
        Read Look-Ahead: Enabled
        Write Cache: Enabled
        SMART Status: Good
        ATA Security Information: Supported, Frozen
        Zoned Device Type: Not a Zoned Device
        Firmware Download Support: Immediate, Segmented
        Specifications Supported:
                ATA8-ACS
                ATA/ATAPI-7
                ATA/ATAPI-6
                ATA/ATAPI-5
                ATA/ATAPI-4
                SATA 3.0
        Features Supported:
                Sanitize
                NCQ
                HPA
                Power Management
                Security
                SMART
                48bit Address
                GPL
                TRIM

SAS HDD Device Information:

Lin: sudo ./openSeaChest_Basics -i -d /dev/sg1
Win: openSeaChest_Basics -i -d PD1
===============================================================================
 openSeaChest - Seagate drive utilities
 Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates
===============================================================================
        Model Number: ST4000NM0043
        Serial Number: Z1QZ04KVG
        Firmware Revision: 0004
        World Wide Name: 500Q0C5005594AEFB
        Copyright: Copyright (c) 2014 Seagate All rights reserved
        Drive Capacity (TB/TiB): 4.00/3.64
        Temperature Data:
                Current Temperature (C): 28
                Highest Temperature (C): Not Reported
                Lowest Temperature (C): Not Reported
        Humidity Data:
                Current Humidity (%): Not Reported
                Highest Humidity (%): Not Reported
                Lowest Humidity (%): Not Reported
        Power On Time:  61 days 11 hours 14 minutes
        Power On Hours: 1475.23
        MaxLBA: 7814037167
        Native MaxLBA: Not Reported
        Logical Sector Size (B): 512
        Physical Sector Size (B): 512
        Sector Alignment: 0
        Rotation Rate (RPM): 7200
        Form Factor (inch): 3.5
        Last DST information:
                Time since last DST (hours): 548.23
                DST Status/Result: 0x0
                DST Test run: 0x1
        Interface speed:
                Port 0 (Current Port)
                        Max Speed (GB/s): 6.0
                        Negotiated Speed (Gb/s): 3.0
                Port 1
                        Max Speed (GB/s): 6.0
                        Negotiated Speed (Gb/s): Not Reported
        Annualized Workload Rate (TB/yr): 0.02
        Total Bytes Read (GB): 2.27
        Total Bytes Written (GB): 2.39
        Drive Reported Utilization (%): Not Reported
        Encryption Support: Self Encrypting
        Cache Size (MiB): Not Reported
        Read Look-Ahead: Enabled
        Write Cache: Enabled
        SMART Status: Good
        ATA Security Information: Not Supported
        Zoned Device Type: Not a Zoned Device
        Firmware Download Support: Immediate
        Specifications Supported:
                SPC-4
        Features Supported:
                EPC
                TCG
                Self Test
                Informational Exceptions
                Format Unit
                Sanitize

SAS SSD: Device Information

Lin: sudo ./openSeaChest_Basics -i -d /dev/sg1
Win: openSeaChest_Basics -i -d PD1
===============================================================================
 openSeaChest - Seagate drive utilities
 Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates
===============================================================================
        Model Number: ST400FM0053
        Serial Number: P3QF13026
        Firmware Revision: 0006
        World Wide Name: 5000QC50069010B4B
        Copyright: Copyright (c) 2014 Seagate All rights reserved -
        Drive Capacity (GB/GiB): 400.09/372.61
        Temperature Data:
                Current Temperature (C): 34
                Highest Temperature (C): Not Reported
                Lowest Temperature (C): Not Reported
        Humidity Data:
                Current Humidity (%): Not Reported
                Highest Humidity (%): Not Reported
                Lowest Humidity (%): Not Reported
        Power On Time:  30 days 21 hours 29 minutes
        Power On Hours: 741.48
        MaxLBA: 781422767
        Native MaxLBA: Not Reported
        Logical Sector Size (B): 512
        Physical Sector Size (B): 4096
        Sector Alignment: 0
        Rotation Rate (RPM): SSD
        Form Factor (inch): 2.5
        Last DST information:
                Time since last DST (hours): 434.48
                DST Status/Result: 0x0
                DST Test run: 0x1
        Interface speed:
                Port 0 (Current Port)
                        Max Speed (GB/s): 12.0
                        Negotiated Speed (Gb/s): 3.0
                Port 1
                        Max Speed (GB/s): 12.0
                        Negotiated Speed (Gb/s): Not Reported
        Annualized Workload Rate (TB/yr): 9.48
        Total Bytes Read (GB): 24.62
        Total Bytes Written (GB): 837.41
        Drive Reported Utilization (%): Not Reported
        Encryption Support: Not Supported
        Cache Size (MiB): Not Reported
        Percentage Used Endurance Indicator (%): 1.00000
        Read Look-Ahead: Enabled
        Write Cache: Enabled
        SMART Status: Good
        ATA Security Information: Not Supported
        Zoned Device Type: Not a Zoned Device
        Firmware Download Support: Immediate, Segmented, Deferred
        Specifications Supported:
                SPC-4
        Features Supported:
                EPC
                Power Comsumption
                UNMAP
                Self Test
                Informational Exceptions
                Format Unit
                Sanitize

SATA SSD SMART Attributes example.

The drive will display its list of supported SMART attributes. Some attributes
are industry standard and most others are vendor unique. Most attributes are
informational and not used to determine a warranty return. Use the --smartCheck
command to determine if one of the warranty attributes has been tripped.

Reminder: Seagate Support does not help to analyze SMART attributes.

Lin: sudo ./openSeaChest_Basics -d /dev/sg1 --smartAttributes
Win: openSeaChest_Basics -d PD1 --smartAttributes
===============================================================================
 openSeaChest - Seagate drive utilities
 Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates
===============================================================================
Attribute Name:                   Status: Nominal: Worst:     Raw (hex):
  1 Read Error Rate               0x000F    0x75    0x63      0x0000000969AFB4
  3 Spin Up Time                  0x0003    0x61    0x61      0x00000000000000
  4 Start/Stop Count              0x0032    0x63    0x63      0x0000000000079E
  5 Retired Sectors Count         0x0033    0x64    0x64      0x00000000000000
  7 Seek Error Rate               0x000F    0x52    0x3C      0x0000000A4D0DAA
  9 Power On Hours                0x0032    0x5D    0x5D      0x00000000001A84
 10 Spin Retry Count              0x0013    0x64    0x64      0x00000000000000
 12 Drive Power Cycle Count       0x0032    0x63    0x63      0x000000000007A5
184 IOEDC Count                   0x0032    0x55    0x55      0x0000000000000F
187 Reported Un-correctable       0x0032    0x64    0x64      0x00000000000000
188 Command Timeout               0x0032    0x64    0xFD      0x00000000000000
189 High Fly Writes               0x003A    0x64    0x64      0x00000000000000
190 Airflow Temperature           0x0022    0x40    0x2E      0x00000026110024
191 Shock Sensor Counter          0x0032    0x64    0x64      0x00000000000000
192 Emergency Retract Count       0x0032    0x64    0x64      0x00000000000042
193 Load-Unlock Count             0x0032    0x44    0x44      0x0000000000FA61
194 Temperature                   0x0022    0x24    0x36      0x00000A00000024
195 ECC On The Fly Count          0x001A    0x2D    0x29      0x0000000969AFB4
197 Pending-Sparing Count         0x0012    0x64    0x64      0x00000000000000
198 Offline Uncorrectable Sectors 0x0010    0x64    0x64      0x00000000000000
199 Ultra DMA CRC Error           0x003E    0xC8    0xC8      0x00000000000000

===============
Version History
===============
SeaChest_SMART is branched off from SeaChest Basics v1.0.4.

v0.0.1  14-Apr-2015  Initial SMART release.  Added --poll.
v0.0.2  12-Aug-2015  Added --testUnitReady. Improved device discovery.
                     Corrections to verbose output.
v0.0.2  16-Oct-2015  1_7_0 libraries.  Added enhanced version information.
                     Added -sat12byte to increase compatibility.  Added
                     --SATInfo to compare ATA vs SCSI identification
                     differences.
v1.0.0  02-May-2016  1_9_1 libraries.  Added new verbosity level. Added
                     --onlySeagate restriction.  Added --modelMatch and
                     --onlyFW filters. --smartAttributes update, added
                     --errorLimit, --dstAndClean
v1.0.2  19-May-2016  1_9_2 libraries fixed scan information from ATAPI devices.
                     Fixed a bug where we could accidentally clear some stored
                     identify data from the device structure. Fixed continuing
                     on when there was a permission denied error opening a
                     drive. Fixed missing Long DST confirmation.
v1.0.3  15-Jun-2016  1_9_3 libraries fixed issues with ATA secure erase
                     commands. Fixed bugs with --modelMatch and --onlyFW
                     filters.
v1.2.0  06-Jul-2016  1_10_0 libraries add --forceATA and --forceSCSI.  Added
                     --smartInfo, --showDSTLog, --smartAutoOffline,
                     --conveyanceDST, --smartAttributeAutosave, and
                     --smartFeature
v1.2.1  14-Jul-2016  1_10_1 libraries adds SMART and power management
                     functions, format polling, endianess detection, buffer
                     size fixes, SAS device statistics, Win32 IOCTL
                     pass-through fix on Win8 and higher. Additional checks
                     when SMART is disabled.
v1.3.0  01-Sep-2016  1_11_1 libraries updates to various printed message,
                     minor bug fixes. Fixed --SATInfo command.
v1.3.0  21-Sep-2016  1_11_2 libraries updates adds --forceATADMA, --forceATAPIO
                     and --forceATAUDMA  (SATA Only).
v1.4.0  10-Oct-2016  1_11_4 libraries updates. Support for multiple devices.
v1.4.0  25-Oct-2016  1_11_5 libraries updates improved LaCie  detection, adds
                     SAT Vendor ID, SAT Product ID, and SAT Product Revision to
                     the -i --SATInfo output.
v1.4.1  27-Oct-2016  1_11_6 libraries updates WWN detection.  Added
                     --enableLegacyUSBPassthrough
v1.4.1  03-Nov-2016  1_11_7 libraries fixed issue with SAS EPC power mode
                     settings.
v1.4.1  13-Dec-2016  1_11_10 libraries fixes a problem when using maxLBA without
                     the corresponding command range option, SAS power mode
                     setting, and Sanitize erase patterns.
v1.5.0  23-Feb-2017  1_13_0 libraries adds support for SAS 12.0Gb/s and
                     22.5Gb/s physical bus speeds, support for double buffered
                     passthrough IOCTLs. New -F, --scanFlags [options:
                     ignoreCSMI allowDuplicates] for Windows tools. Add CSMI
                     support to all Windows version tools.
v1.5.0  06-Mar-2017  1_13_2 libraries adds Enhanced device information output
                     for SAS features.
v1.6.0  02-May-2017  1_14_3 libraries.  Adds --seagateClean.
v1.6.1  15-May-2017  Refinements to --seagateClean.  Fixed an exit code for
                     unknown options
v1.7.0  01-Jun-2017  Adds --seagateClean.
v1.8.0  14-Jun-2017  1_15_0 libraries adds bug fix malformed command line
                     should exit with code = 1; added detection of parallel ATA
                     and SCSI speeds; temperature data on ATA now uses the
                     values from the SCT status log or device statistics log.
                     Bug fix where the "-d all" was not filtering out csmi
                     drives like it is supposed to causing duplicate drives to
                     show up.  Adds the child drive matching options
                     --childModelMatch, --childOnlyFW, and --childNewFW.  --idd
                     now supports SAS.  --idd [short | long | repair]  replaces
                     '70 | 71 | 72' syntax. --abortIDD added.   --setMRIE added.
v1.9.0  14-Jul-2017  1_16_1 libraries adds support for ATA drives that have the
                     Sense Data Reporting feature enabled, changes to how we
                     interpret the completion status from the drive, new Sense
                     Data ASC, ASCQ definitions from SPC5. Adds --Scan (or -S,
                     note the capital S) aggressive system scan.
v1.9.0  27-Jul-2017  1_16_2 libraries enhances Seagate brand detection.
v1.9.0  19-Sep-2017  1_16_4 libraries fixes SCSI "--progress format", added
                     reading remanufacture time for SAS when the drive reports
                     a time, fixed SAS --abortDST.
v1.9.0  25-Sep-2017  1_17_0 libraries adds improved SATA device discovery on
                     SAS adapters, added NVMe read, write & Flush commands.
v1.9.1  10-Oct-2017  1_17_1 libraries adds Better handling of NVMe as a SCSI
                     device, SAT library strings, and fixes to Read-Buffer
                     error history (ISL). Updated copyright notice, invalid
                     command line options now only display an error instead of
                     long help. Added showing the SMART trip failure reason when
                     possible.
v1.9.1  12-Oct-2017  1_17_3 libraries improves Fast-Format compatibility on SAS.
v1.9.1  26-Oct-2017  1_17_5 libraries fixes SATA drive discovery behind HBAs
                     that don't show as SATA and don't support the SAT VPD
                     page; added Automatic fallback to 12byte CDBs during
                     initial device discovery;  integrated fixes for SAS
                     firmware download and fixes for SAS LongDST time
                     calculation; added detection of TCG Pyrite and Opalite
                     drives.
v1.9.1  31-Oct-2017  1_17_6 libraries adds ATA Security compatibility with SATL
                     on some LSI adapters, corrects firmware download issue
                     under Windows 10 API.
v1.9.1  02-Nov-2017  1_17_7 libraries fixes Long DST time on SCSI/SAS products.

The above history is provided as a courtesy to show the original SeaChest
development activity.

============================
openSeaChest Version History
============================
v1.9.1   12-Nov-2017  1_17_x libraries.  Launch date of the Seagate openSeaChest
open source project for storage devices.
v1.9.1  19-Apr-2018  1_18_0 libraries improves device detection of CD-ROM and
                     USB flash drives, support for early 90's PATA drives that
                     don't support LBA mode, bug fix where the last digit of
                     the SCSI Unit Serial Number was being dropped, additional
                     logic for deferred download completion status. --scan
                     --onlySeagate for just Seagate drives in a large system,
                     Long Drive Self Test Time in the -i output, write protect
                     status has been added for SCSI and NVMe in the -i output,
                     IDD enhancements for SAS, IDD enhancements to allow
                     captive mode on SATA, added USB Hacks to better support
                     some odd-ball USB devices and prevent crashes and improve
                     performance for some operations on them by issuing test
                     unit ready commands when something fails during device
                     discovery, automatic fall back to SAT 10 byte commands
                     during device discovery to help work with some USB
                     devices, some Legacy SCSI support enhancements (partially
                     from USB hacks development), enhanced SD to SG mapping in
                     Linux.
v1.10.0 25-Jul-2018  Adds --defectFormat, --showSCSIDefects
v1.11.0 21-Sep-2018  1_18_2 libraries Added in reading os-release PRETTY_NAME
                     field to get the OS name under linux; NVMe enabled;  fixed
                     a bug in the ATA activate FW command; added in reading ID
                     Data log and Device statistics logs page 0 to check the
                     list of supported pages; fixed a bug in the loop used to
                     read mode pages for -i information on SAS; IDD SAS
                     improvements; fixed a bug in DST & Clean with ATA drives
                     behind SCSI controllers. Fix for --modelMatch that have
                     spaces in the name. Added additional information to the
                     banner and -V data to show support levels. Add general
                     support for NVMe and NVMe specific identify data to "-i"
                     command. Adds --showSMARTErrorLog, --smartErrorLogFormat.
v1.11.0 18-Oct-2018  1_18_3 libraries Added NVMe generic read command support.
v1.12.0 03-May-2019  1_19_18 libraries added per device verbosity, --deviceInfo
                     adds SAS (not SATA) FastFormat for Features Supported
                     section,  --deviceInfo now gives Low Current Spinup
                     status.
v1.12.0 10-Jun-2019  1_19_23 libraries added SNTL (SCSI to NVMe translator),
                     updated software SAT translator to use dataset management
                     XL command, fixes for issuing vendor unique commands under
                     Windows, improved fast format support detection, and
                     refactored verbose output for NVMe commands.
v1.12.2 19-Jul-2019  1_19_25 libraries. Adds --noTimeLimit option for DST.
v1.13.1 04-Feb-2020  1_21_30 libraries add in check for Elevated Privileges
                     (sudo, run as administrator) before trying to talk to
                     devices, new exit code 9 if privileges are missing;
                     printing the USB VID/PID in the device info; fix to sg
                     helper to support large systems; many changes in support
                     of dual actuators (example: warning that EPC settings
                     affect multiple LUNs); overhaul to USB device detection
                     and support, incorporating a new USB hacks and workarounds
                     approach which uses a lookup table listing various USB
                     bridge VIDs/PIDs and their specific issues; separate
                     Seagate SAS SN and PCBA SN.
v1.13.2 13-Apr-2020  1_21_30 libraries, fix memory allocation during the scan
                     command.

===========================================
About openSeaChest Command Line Diagnostics
===========================================
Seagate offers both graphical user interface (GUI) and command line interface
(CLI) diagnostic tools for our storage devices.  SeaTools for Windows and
SeaTools Bootable for end users are the two most popular GUI tools.  These
tools support 15 languages.

openSeaChest diagnostics are command line utilities which are available for
expert users.  These command line tools assume the user is knowledgeable about
running software from the operating system command prompt.  CLI tools are in
the English language only and use "command line arguments" to define the
various tasks and specific devices.  openSeaChest diagnostics are available for
both Linux and Windows environments.

Linux versions of openSeaChest tools are available as stand alone 32 or 64-bit
executables you can copy to your own system.  Windows OS versions of
openSeaChest diagnostics are installed through a typical setup wizard and can
be removed via the Control Panel.

In addition, Seagate offers a tool to build a bootable USB openSeaChest flash
drive which boots to a 32-bit Linux command prompt.  This is a Windows
executable file which formats a USB Flash drive you provide.  It copies over
all the files needed to use it as a bootable device for the openSeaChest
diagnostic software. All data on the USB Flash drive will be erased so be sure
to protect any valuable files.

Technical Support for openSeaChest drive utilities is not available.  If you
have the time to send us some feedback about this software, especially if you
notice something we should fix or improve, we would greatly appreciate hearing
from you.  To report your comments and suggestions, please use this email
seaboard@seagate.com.  Please let us know the name and version of the tool you
are using.

openSeaChest drive utilities support SATA, SAS and USB interface devices.

openSeaChest Basics - Contains the most important tests and tools.

Other openSeaChest "break out" utilities are available and listed below which
offer more in-depth functionality in specific areas. These are:

openSeaChest Configure - Tools to control various settings on the drives are
brought together into this one tool.  Typical commands, for example, include
Write Cache and Read Lookahead Cache enable or disable.

openSeaChest Erase - The focus is on data erasure.  There are many different
choices for erasing data from simple boot track erase to full cryptographic
erasure (when supported).  Be sure to back up important data before using this
tool.  Seagate is not responsible for lost user data.  This tool only works on
Seagate drives.

openSeaChest Firmware - Seagate products are run by firmware.  Having the
latest firmware can improve performance and or reliability of your product.
Seagate recommends applying new firmware to enhance the performance and or
reliability of your drive.  Most products may see one or two firmware updates
within the early life of the product.

openSeaChest Format - Storage products which utilize the SAS, SCSI or Fibre
Channel interfaces are able to perform a full low-level media format in the
field.  The SCSI Format Unit command offers many specialty options to
accommodate a variety of conditions and to fine tune the procedure.  This
complex command deserves its own "break out" utility.

openSeaChest GenericTests - Read Tests are the original disk drive diagnostic
which is to just read every sector on the drive, sequentially.  This tool
offers several common read tests which can be defined by either time or range.
In addition, the Long Generic test has the ability to repair problem sectors,
possibly eliminating an unnecessary drive return.

openSeaChest Info - Historical generic activity logs (like total bytes written
and power on hours) and performance logs (like temperature) are available for
analytical review.  Identification and inquiry data stored on the drive is also
provided.  A view of SMART and device statistics is available when supported by
the drive.

openSeaChest PowerControl - Seagate disk drives offer a multitude of options to
manage power.  This tool manipulates the various power modes.

openSeaChest Security - Various settings are available on modern Seagate disk
drives which may be locked and unlocked.  These settings may interact with the
operating systems and systems BIOS.  Options also include cryptographic erase
for Self-Encrypting Drives (SED).

openSeaChest SMART - This tool provides a closer look at the collected SMART
attributes data.  SMART stands for Self-Monitoring, Analysis and Reporting
Technology.  Short Drive Self Test is included as one of the standard SMART
commands. In addition, the DST & Clean test has the ability to repair problem
sectors, possibly eliminating an unnecessary drive return.

=================================
Support and Open Source Statement
=================================
Seagate offers technical support for disk drive installation.  If you have any
questions related to Seagate products and technologies, feel free to submit
your request on our web site. See the web site for a list of world-wide
telephone numbers.

Seagate Support:
http://www.seagate.com/support-home/
Contact Us:
http://www.seagate.com/contacts/

Please report bugs/suggestions to https://github.com/Seagate/openSeaChest.
Include the output of --version information in the email. See the user guide
section 'General Usage Hints' for information about saving output to a log file.

This software uses open source packages obtained with permission from the
relevant parties. For a complete list of open source components, sources and
licenses, please see our Linux USB Boot Maker Utility FAQ for additional
information.

The newest online version of the openSeaChest Utilities documentation, open
source usage and acknowledgement licenses, and our Linux USB Boot Maker FAQ can
be found at: https://github.com/Seagate/openSeaChest.

Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates
======================================================================

BINARIES and SOURCE CODE files of the openSeaChest open source project have
been made available to you under the Mozilla Public License 2.0 (MPL).  Mozilla
is the custodian of the Mozilla Public License ("MPL"), an open source/free
software license.

https://www.mozilla.org/en-US/MPL/

Mozilla Public License Version 2.0
==================================

1. Definitions
--------------

1.1. "Contributor"
    means each individual or legal entity that creates, contributes to
    the creation of, or owns Covered Software.

1.2. "Contributor Version"
    means the combination of the Contributions of others (if any) used
    by a Contributor and that particular Contributor's Contribution.

1.3. "Contribution"
    means Covered Software of a particular Contributor.

1.4. "Covered Software"
    means Source Code Form to which the initial Contributor has attached
    the notice in Exhibit A, the Executable Form of such Source Code
    Form, and Modifications of such Source Code Form, in each case
    including portions thereof.

1.5. "Incompatible With Secondary Licenses"
    means

    (a) that the initial Contributor has attached the notice described
        in Exhibit B to the Covered Software; or

    (b) that the Covered Software was made available under the terms of
        version 1.1 or earlier of the License, but not also under the
        terms of a Secondary License.

1.6. "Executable Form"
    means any form of the work other than Source Code Form.

1.7. "Larger Work"
    means a work that combines Covered Software with other material, in
    a separate file or files, that is not Covered Software.

1.8. "License"
    means this document.

1.9. "Licensable"
    means having the right to grant, to the maximum extent possible,
    whether at the time of the initial grant or subsequently, any and
    all of the rights conveyed by this License.

1.10. "Modifications"
    means any of the following:

    (a) any file in Source Code Form that results from an addition to,
        deletion from, or modification of the contents of Covered
        Software; or

    (b) any new file in Source Code Form that contains any Covered
        Software.

1.11. "Patent Claims" of a Contributor
    means any patent claim(s), including without limitation, method,
    process, and apparatus claims, in any patent Licensable by such
    Contributor that would be infringed, but for the grant of the
    License, by the making, using, selling, offering for sale, having
    made, import, or transfer of either its Contributions or its
    Contributor Version.

1.12. "Secondary License"
    means either the GNU General Public License, Version 2.0, the GNU
    Lesser General Public License, Version 2.1, the GNU Affero General
    Public License, Version 3.0, or any later versions of those
    licenses.

1.13. "Source Code Form"
    means the form of the work preferred for making modifications.

1.14. "You" (or "Your")
    means an individual or a legal entity exercising rights under this
    License. For legal entities, "You" includes any entity that
    controls, is controlled by, or is under common control with You. For
    purposes of this definition, "control" means (a) the power, direct
    or indirect, to cause the direction or management of such entity,
    whether by contract or otherwise, or (b) ownership of more than
    fifty percent (50%) of the outstanding shares or beneficial
    ownership of such entity.

2. License Grants and Conditions
--------------------------------

2.1. Grants

Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:

(a) under intellectual property rights (other than patent or trademark)
    Licensable by such Contributor to use, reproduce, make available,
    modify, display, perform, distribute, and otherwise exploit its
    Contributions, either on an unmodified basis, with Modifications, or
    as part of a Larger Work; and

(b) under Patent Claims of such Contributor to make, use, sell, offer
    for sale, have made, import, and otherwise transfer either its
    Contributions or its Contributor Version.

2.2. Effective Date

The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.

2.3. Limitations on Grant Scope

The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:

(a) for any code that a Contributor has removed from Covered Software;
    or

(b) for infringements caused by: (i) Your and any other third party's
    modifications of Covered Software, or (ii) the combination of its
    Contributions with other software (except as part of its Contributor
    Version); or

(c) under Patent Claims infringed by Covered Software in the absence of
    its Contributions.

This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).

2.4. Subsequent Licenses

No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).

2.5. Representation

Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.

2.6. Fair Use

This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.

2.7. Conditions

Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.

3. Responsibilities
-------------------

3.1. Distribution of Source Form

All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.

3.2. Distribution of Executable Form

If You distribute Covered Software in Executable Form then:

(a) such Covered Software must also be made available in Source Code
    Form, as described in Section 3.1, and You must inform recipients of
    the Executable Form how they can obtain a copy of such Source Code
    Form by reasonable means in a timely manner, at a charge no more
    than the cost of distribution to the recipient; and

(b) You may distribute such Executable Form under the terms of this
    License, or sublicense it under different terms, provided that the
    license for the Executable Form does not attempt to limit or alter
    the recipients' rights in the Source Code Form under this License.

3.3. Distribution of a Larger Work

You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).

3.4. Notices

You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.

3.5. Application of Additional Terms

You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.

4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------

If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.

5. Termination
--------------

5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.

5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.

5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.

************************************************************************
*                                                                      *
*  6. Disclaimer of Warranty                                           *
*  -------------------------                                           *
*                                                                      *
*  Covered Software is provided under this License on an "as is"       *
*  basis, without warranty of any kind, either expressed, implied, or  *
*  statutory, including, without limitation, warranties that the       *
*  Covered Software is free of defects, merchantable, fit for a        *
*  particular purpose or non-infringing. The entire risk as to the     *
*  quality and performance of the Covered Software is with You.        *
*  Should any Covered Software prove defective in any respect, You     *
*  (not any Contributor) assume the cost of any necessary servicing,   *
*  repair, or correction. This disclaimer of warranty constitutes an   *
*  essential part of this License. No use of any Covered Software is   *
*  authorized under this License except under this disclaimer.         *
*                                                                      *
************************************************************************

************************************************************************
*                                                                      *
*  7. Limitation of Liability                                          *
*  --------------------------                                          *
*                                                                      *
*  Under no circumstances and under no legal theory, whether tort      *
*  (including negligence), contract, or otherwise, shall any           *
*  Contributor, or anyone who distributes Covered Software as          *
*  permitted above, be liable to You for any direct, indirect,         *
*  special, incidental, or consequential damages of any character      *
*  including, without limitation, damages for lost profits, loss of    *
*  goodwill, work stoppage, computer failure or malfunction, or any    *
*  and all other commercial damages or losses, even if such party      *
*  shall have been informed of the possibility of such damages. This   *
*  limitation of liability shall not apply to liability for death or   *
*  personal injury resulting from such party's negligence to the       *
*  extent applicable law prohibits such limitation. Some               *
*  jurisdictions do not allow the exclusion or limitation of           *
*  incidental or consequential damages, so this exclusion and          *
*  limitation may not apply to You.                                    *
*                                                                      *
************************************************************************

8. Litigation
-------------

Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.

9. Miscellaneous
----------------

This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.

10. Versions of the License
---------------------------

10.1. New Versions

Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.

10.2. Effect of New Versions

You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.

10.3. Modified Versions

If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).

10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses

If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.

Exhibit A - Source Code Form License Notice
-------------------------------------------

  This Source Code Form is subject to the terms of the Mozilla Public
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at http://mozilla.org/MPL/2.0/.

If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.

You may add additional accurate notices of copyright ownership.

Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------

  This Source Code Form is "Incompatible With Secondary Licenses", as
  defined by the Mozilla Public License, v. 2.0.
