blkdiscard
Discard device sectors (permanetly deleting data). toybox
On Linux
Linux
Discard device sectors (permanetly deleting data). Free space can improve flash performance and lifetime by wear leveling and collating data. (Some filesystem/driver combinations can do this automatically.) OFFSET and LENGTH must be aligned to the device sector size. Default without -o/-l discards the entire device. (You have been warned.)
blkdiscard [-szf] [-o OFFSET] [-l LENGTH] DEVICE
-o OFFSETStart at OFFSET (--offset, default 0)-l LENGTHLENGTH to discard (--length, default all)-sOverwrite discarded data (--secure)-zZero-fill rather than discard (--zeroout)-fDisable check for mounted filesystem (--force)Linux
Discard device sectors on storage devices. Useful for SSDs.
Discard all sectors on a device, removing all data
blkdiscard /dev/deviceIdentifySecurely discard all blocks on a device, removing all data
blkdiscard --secure /dev/deviceIdentifyDiscard the first 100 MB of a device
blkdiscard --length 100MB /dev/deviceIdentify