OS Manuals

/usr/bin/sg_sanitize

SCSI utilities for Linux, Unix and Windows

From sg3-utils 1.49-r3 (enterprise-packages), captured 2026-11-08 by running sg_sanitize --help (exit 0). permalink

Usage: sg_sanitize [--ause] [--block] [--count=OC] [--crypto] [--dry-run]
                   [--early] [--fail] [--help] [--invert] [--ipl=LEN]
                   [--overwrite] [--pattern=PF] [--quick] [--test=TE]
                   [--timeout=SECS] [--verbose] [--version] [--wait]
                   [--zero] [--znr] DEVICE
  where:
    --ause|-A            set AUSE bit in cdb
    --block|-B           do BLOCK ERASE sanitize
    --count=OC|-c OC     OC is overwrite count field (from 1 (def) to 31)
    --crypto|-C          do CRYPTOGRAPHIC ERASE sanitize
    --desc|-d            polling request sense sets 'desc' field
                         (def: clear 'desc' field)
    --dry-run|-D         to preparation but bypass SANITIZE command
    --early|-e           exit once sanitize started (IMMED set in cdb)
                         user can monitor progress with REQUEST SENSE
    --fail|-F            do EXIT FAILURE MODE sanitize
    --help|-h            print out usage message
    --invert|-I          set INVERT bit in OVERWRITE parameter list
    --ipl=LEN|-i LEN     initialization pattern length (in bytes)
    --overwrite|-O       do OVERWRITE sanitize
    --pattern=PF|-p PF    PF is file containing initialization pattern
                          for OVERWRITE
    --quick|-Q           start sanitize without pause for user
                         intervention (i.e. no time to reconsider)
    --test=TE|-T TE      TE is placed in TEST field of OVERWRITE
                         parameter list (def: 0)
    --timeout=SECS|-t SECS    SANITIZE command timeout in seconds
    --verbose|-v         increase verbosity
    --version|-V         print version string then exit
    --wait|-w            wait for command to finish (could take hours)
    --zero|-z            use pattern of zeros for OVERWRITE
    --znr|-Z             set ZNR (zone no reset) bit in cdb

Performs a SCSI SANITIZE command.
    <<<WARNING>>>: all data on DEVICE will be lost.
Default action is to give user time to reconsider; then execute SANITIZE
command with IMMED bit set; then use REQUEST SENSE command every 60
seconds to poll for a progress indication; then exit when there is no
more progress indication.
Options (21)
OptionDescriptionSource
--count, -c OC|-cwhere OC is the "overwrite count" associated with the "overwrite" sanitize operation.help + man
--ipl, -i LEN|-iset the initialization pattern length to LEN bytes.help + man
--pattern, -p PF|-pwhere PF is the filename of a file containing the initialization pattern required by an "overwrite" sanitize operation.help + man
--test, -T TE|-Tset the TEST field in the overwrite service action parameter list.help + man
--timeout, -t SECS|-twhere SECS is the number of seconds used for the timeout on the SANITIZE command.help + man
-A, --ausesets the AUSE bit in the cdb. (in the manual page but not in --help)man
-B, --blockperform a "block erase" sanitize operation. (in the manual page but not in --help)man
-C, --cryptoperform a "cryptographic erase" sanitize operation. (in the manual page but not in --help)man
-d, --descsets the DESC field in the REQUEST SENSE command used for polling. (in the manual page but not in --help)man
-D, --dry-runthis option will parse the command line, do all the preparation but bypass the actual SANITIZE command. (in the manual page but not in --help)man
-e, --earlythe default action of this utility is to poll the disk every 60 seconds to fetch the progress indication until the sanitize is finished. (in the manual page but not in --help)man
-F, --failperform an "exit failure mode" sanitize operation. (in the manual page but not in --help)man
-h, --helpprint out the usage information then exit. (in the manual page but not in --help)man
-I, --invertset the INVERT bit in the overwrite service action parameter list. (in the manual page but not in --help)man
-O, --overwriteperform an "overwrite" sanitize operation. (in the manual page but not in --help)man
-Q, --quickthe default action (i.e. when the option is not given) is to give the user 15 seconds to reconsider doing a sanitize operation on the DEVICE. (in the manual page but not in --help)man
-v, --verboseincrease the level of verbosity, (i.e. debug output). (in the manual page but not in --help)man
-V, --versionprint the version string and then exit. (in the manual page but not in --help)man
-w, --waitthe default action (i.e. without this option and the --early option) is to start the SANITIZE command with the IMMED bit set then poll for the progress indication with the REQUEST SENSE command until… (in the manual page but not in --help)man
-z, --zerowith an "overwrite" sanitize operation this option causes the initialization pattern to be zero (4 zeros are used as the initialization pattern). (in the manual page but not in --help)man
-Z, --znrsets ZNR bit (zoned no reset) in cdb. (in the manual page but not in --help)man
Exit status (1) from the manual page
0it is successful

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.