1# sg_unmap_example.txt 2# This is an example of the contents of a file that can be given to sg_unmap 3# For example, assume the /dev/sdc is a scratch disk (e.g. one made by the 4# scsi_debug kernel module) then: 5# sg_unmap --in=sg_unmap_example.txt /dev/sdc 6 70x12345677,1 # unmap LBA 0x12345677 80x12345678 2 # unmap LBA 0x12345678 and 0x12345679 90x12340000 3333 # unmap 3333 blocks starting at LBA 0x12340000 10 110X5a5a5a5a5a 0 # unmaps 0 blocks (i.e. does nothing) 12 13 a5a5a5h 147 # unmap 7 blocks starting at LBA 0xa5a5a5 15 16# Note that there can be leading and trailing whitespace and whitespace 17# (plus comma) can be a separator. 18# 19# Example invocation: 20# $ sg_unmap --in=../examples/sg_unmap_example.txt -vv /dev/sdc 21# open /dev/sg2 with flags=0x802 22# unmap cdb: 42 00 00 00 00 00 00 00 58 00 23# unmap parameter list: 24# 00 56 00 50 00 00 00 00 00 00 00 00 12 34 56 77 25# 00 00 00 01 00 00 00 00 00 00 00 00 12 34 56 78 26# 00 00 00 02 00 00 00 00 00 00 00 00 12 34 00 00 27# 00 00 0d 05 00 00 00 00 00 00 00 5a 5a 5a 5a 5a 28# 00 00 00 00 00 00 00 00 00 00 00 00 00 a5 a5 a5 29# 00 00 00 07 00 00 00 00 30# sg_cmds_process_resp: slen=18 31# unmap: Fixed format, current; Sense key: Illegal Request 32# Additional sense: Invalid command operation code 33# Raw sense data (in hex): 34# 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 35# 00 00 36# UNMAP not supported 37# 38# -------------------------------------------------------- 39# Notice the 8 byte header then 5 descriptors in the parameter 40# list 41