|sets the Anchor bit in the command (introduced in sbc3r22).|
|sets the Group number field to GN. Defaults to a value of zero. GN should be a value between 0 and 31.|
|-h, --help||output the usage message then exit.|
|where FILE is a file name containing pairs of values. The first member of each pair is a starting LBA and the second member of the pair is the number of logical blocks to unmap from and including that starting LBA. Values are interpreted as decimal unless indicated otherwise. This option cannot be present with the --lba= option.|
|where LBA,LBA... is a string of comma (or space) separated values that are interpreted as starting logical block addresses. Each number is interpreted as decimal unless prefixed by 0x or 0X (or it has a trailing h or H). An argument that contains any space separators needs to be quoted (or otherwise escaped). When this option is given then the --num= option must also be given and they must contain the same number of elements in their arguments.|
|where NUM,NUM... is a string of comma (or space) separated values that are interpreted as a number of logical blocks to unmap. Each number is interpreted as decimal unless prefixed by 0x or 0X (or it has a trailing h or H). Note that 0 blocks is acceptable. An argument that contains any space separators needs to be quoted (or otherwise escaped). When this option is given then the --lba= option must also be given and they must contain the same number of elements in their arguments.|
|where TO is a timeout value (in seconds) for the UNMAP command. The default value is 60 seconds.|
|increase the level of verbosity, (i.e. debug output).|
|print the version string and then exit.|
Some limits: an LBA can be up to 64 bits, a NUM up to 32 bits (imposed by structure of UNMAP SCSI command parameter data). The NUM is further constrained by the MAXIMUM UNMAP LBA COUNT field in the BLOCK LIMITS VPD page (0xb0). The maximum number of LBA,NUM pairs is limited to 128 by this utility and may be further constrained by the MAXIMUM UNMAP BLOCK DESCRIPTOR COUNT field in the BLOCK LIMITS VPD page.
Since it is unclear how long the UNMAP command will take to execute a --timeout=" option has been provided. The default timeout period is 60 seconds. If all the logical blocks on a logical unit (e.g. a disk drive) are to be unmapped then the FORMAT UNIT SCSI command (see the sg_format utility) may be considered as an alternative.
Support for logical block provisioning is indicated by the LBPME bit in the response to the SCSI READ CAPACITY (16) command (see the sg_readcap utility).
In SBC-3 revision 25 the LBPU and ANC_SUP bits where added to the Logical Block Provisioning VPD page. When LBPU is set it indicates that the device supports the UNMAP command. When the ANC_SUP bit is set it indicates the device supports anchored LBAs.
The SCSI UNMAP command does the "right thing" with respect to command queueing. However its ATA counterpart: the DATA SET MANAGEMENT command with the "Trim" bit set does not interact well with SATA queueing known as NCQ. To address this problem T13 have introduced a new command called SFQ DATA SET MANAGEMENT which also has a Trim bit.
In the examples directory of the sg3_utils package there is a sg_unmap_example.txt file that shows the format that the --in= option accepts.
The exit status of sg_unmap is 0 when it is successful. Otherwise see the sg3_utils(8) man page.
Written by Douglas Gilbert.
Report bugs to <dgilbert at interlog dot com>.
Copyright © 2009-2014 Douglas Gilbert
This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|sg3_utils-1.39||SG_UNMAP (8)||April 2014|