Usage: sg_unmap [--all=ST,RN[,LA]] [--anchor] [--dry-run] [--force] [--grpnum=GN] [--help] [--in=FILE] [--lba=LBA,LBA...] [--num=NUM,NUM...] [--timeout=TO] [--verbose] [--version] DEVICE where: --all=ST,RN[,LA]|-A ST,RN[,LA] start unmaps at LBA ST, RN blocks per unmap until the end of disk, or until and including LBA LA (last) --anchor|-a set anchor field in cdb --dry-run|-d prepare but skip UNMAP call(s) --force|-f don't ask for confirmation before zapping media --grpnum=GN|-g GN GN is group number field (def: 0) --help|-h print out usage message --in=FILE|-I FILE read LBA, NUM pairs from FILE (if FILE is '-' then stdin is read) --lba=LBA,LBA...|-l LBA,LBA... LBA is the logical block address to start NUM unmaps --num=NUM,NUM...|-n NUM,NUM... NUM is number of logical blocks to unmap starting at corresponding LBA --timeout=TO|-t TO command timeout (unit: seconds) (def: 60) --verbose|-v increase verbosity --version|-V print version string and exit Perform a SCSI UNMAP command. LBA, NUM and the values in FILE are assumed to be decimal. Use '0x' prefix or 'h' suffix for hex values. Example to unmap LBA 0x12345: sg_unmap --lba=0x12345 --num=1 /dev/sdb Example to unmap starting at LBA 0x12345, 256 blocks per command: sg_unmap --all=0x12345,256 /dev/sg2 until the end if /dev/sg2 (assumed to be a storage device) WARNING: This utility will destroy data on DEVICE in the given range(s) that will be unmapped. Unmap is also known as 'trim' and is irreversible.