# phpman > man > sg_sat_read_gplog(8)

[SG_SAT_READ_GPLOG(8)](https://www.chedong.com/phpMan.php/man/SGSATREADGPLOG/8/markdown)                          SG3_UTILS                         [SG_SAT_READ_GPLOG(8)](https://www.chedong.com/phpMan.php/man/SGSATREADGPLOG/8/markdown)



## NAME
       sg_sat_read_gplog - use ATA READ LOG EXT command via a SCSI to ATA Translation (SAT) layer

## SYNOPSIS
       **sg**___**sat**___**read**___**gplog**   [_--ck_cond_]   [_--count=CO_]   [_--dma_]   [_--help_]  [_--hex_]  [_--len=_{16|12}]
       [_--log=_LA] [_--page=_PN] [_--readonly_] [_--verbose_] [_--version_] _DEVICE_

## DESCRIPTION
       This utility sends an ATA READ LOG EXT or an ATA READ LOG DMA EXT command to the _DEVICE_. This
       command  is  used  to read the general purpose log of (S)ATA disks (not ATAPI devices such as
       DVD driver). Rather than send the READ LOG (DMA) EXT command directly to  the  device  it  is
       sent  via  a SCSI transport which is assumed to contain a SCSI to ATA Translation (SAT) Layer
       (SATL). The SATL may be in an operating system driver, in host bus adapter (HBA) firmware  or
       in some external enclosure.

       This  utility  does not currently attempt to decode the response from the ATA disk, rather it
       outputs the response in ASCII hexadecimal grouped in 16 bit words. Following ATA  conventions
       those  words  are decoded little endian (note that SCSI commands use a big endian representa‐
       tion). In the future this utility may attempt to decode some log  pages,  perhaps  using  the
       _--decode_ option.

       The  SAT-2  standard  (SAT ANSI INCITS 465-2010, prior draft: sat2r09.pdf at www.t10.org) de‐
       fines two SCSI "ATA PASS-THROUGH" commands: one using a 16 byte "cdb" and the other with a 12
       byte cdb. This utility defaults to using the 16 byte cdb variant.

## OPTIONS
       Arguments to long options are mandatory for short options as well.

### -C --ck
              sets  the  CK_COND  bit in the ATA PASS-THROUGH SCSI cdb. The default setting is clear
              (i.e. 0). When set the SATL should yield a sense buffer containing a  ATA  Result  de‐
              scriptor  irrespective  of whether the ATA command succeeded or failed. When clear the
              SATL should only yield a sense buffer containing a ATA Result descriptor  if  the  ATA
              command failed.

### -c --count
              the  number  _CO_  is  placed in the "count" field in the ATA READ LOG EXT command. This
              specified the number of 512-byte blocks of data to be read from the specified log.

### -d --dma
              use the ATA READ LOG DMA EXT command instead of ATA READ LOG EXT  command.   Some  de‐
              vices require this to return valid log data.

### -h --help
              outputs the usage message summarizing command line options then exits.  Ignores _DEVICE_
              if given.

### -H --hex
              when given once, the response is output in ASCII hexadecimal bytes. When given  twice,
              then  the response is grouped into 16 bit words using ATA conventions (i.e. little en‐
              dian); this is the default output (i.e. when this option is  not  given).  When  given
              thrice  (i.e. '-HHH') the output is in hex, grouped in 16 bit words (without a leading
              offset and trailing ASCII on each line), in a format that is  acceptable  for  'hdparm
              --Istdin' to process.

### -L --log
              the number _LA_ is known as the "log address" in the ATA standards and is placed in bits
              7:0 of the "lba" field of the ATA READ LOG (DMA) EXT command. This specifies  the  log
              to  be  returned (See ATA-ACS for a detailed list of available log addresses). The de‐
              fault value placed in the "lba field is 0, returning the directory of available  logs.
              The maximum value allowed for _LOG_ is 0xff.

### -p --page
              the  number _PN_ is the page number (within the log address) and is placed in bits 32:16
              of the "lba" field of the ATA READ LOG (DMA) EXT command. The default value placed  in
              the "lba" field is 0. The maximum value allowed for _LOG_ is 0xffff.

### -l --len
              this  is the length of the SCSI cdb used for the ATA PASS-THROUGH commands.  The argu‐
              ment can either be 16 or 12. The default is 16. Some  SCSI  transports  cannot  convey
              SCSI commands longer than 12 bytes.

### -r --readonly
              causes the _DEVICE_ to be opened with the read-only flag (O_RDONLY in Unix). The default
              action is to open _DEVICE_ with the read-write flag (O_RDWR  in  Unix).  In  some  cases
              sending  power  management  commands  to  ATA  disks are defeated by OS actions on the
              close() if the _DEVICE_ was opened with the read-write flag (e.g. the OS might think  it
              needs to flush something to disk).

### -v --verbose
              increases the level or verbosity.

### -V --version
              print out version string

## NOTES
       Prior  to  Linux kernel 2.6.29 USB mass storage limited sense data to 18 bytes which made the
       **--ck**___**cond** option yield strange (truncated) results.

## EXIT STATUS
       The exit status  of  sg_sat_read_gplog  is  0  when  it  is  successful.  Otherwise  see  the
       [sg3_utils(8)](https://www.chedong.com/phpMan.php/man/sg3utils/8/markdown) man page.

## AUTHOR
       Written by Hannes Reinecke and Douglas Gilbert

## REPORTING BUGS
       Report bugs to <dgilbert at interlog dot com>.

## COPYRIGHT
       Copyright © 2014-2015 Hannes Reinecke, SUSE Linux GmbH
       This software is distributed under a FreeBSD license. There is NO warranty; not even for MER‐
       CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO
       **sg**___**sat**___**identify(sg3**___**utils),** **sg**___**inq(sg3**___**utils),** **sdparm(sdparm),** **hdparm(hdparm)**



sg3_utils-1.41                               April 2015                         [SG_SAT_READ_GPLOG(8)](https://www.chedong.com/phpMan.php/man/SGSATREADGPLOG/8/markdown)
