badblocks Command Examples

Search a device for bad blocks. Some usages of badblocks can cause destructive actions, such as erasing all data on a disk, including the partition table. More information: https://manned.org/badblocks.

sudo badblocks {{/dev/sdX}}

sudo badblocks -n {{/dev/sdX}}

sudo badblocks -w {{/dev/sdX}}

sudo badblocks -svw {{/dev/sdX}}

sudo badblocks -o {{path/to/file}} -w {{/dev/sdX}}

sudo badblocks -w -b {{4096}} -c {{65536}} {{/dev/sdX}}