Badblocks - Examples

Examples

badblocks -nvs /dev/sdb

This would check the drive "sdb" in non-destructive read-write mode and display progress by writing out the block numbers as they are checked.

badblocks -wvs /dev/sdb6

This would check the sixth partition of the drive "sdb", in destructive read-write mode and display progress by writing out the block numbers as they are checked. All data will be overwritten at the block level. If used on an entire disk as in the previous example, it destroys MBRs, partitions and data alike.

badblocks -wvsb 4096 /dev/sdb

This writes 4 different patterns on the whole drive /dev/sdb and verifies by reading back. Modern disk drives will probably not show any defective sectors because they silently remap bad sectors to spare tracks, but running the program with a new drive for several days will test the whole surface, and when reading it afterwards S.M.A.R.T. data will eventually show reallocated sectors.

Using the -w option on a device containing an existing file system erases the data on that device.

Read more about this topic:  Badblocks

Famous quotes containing the word examples:

    It is hardly to be believed how spiritual reflections when mixed with a little physics can hold people’s attention and give them a livelier idea of God than do the often ill-applied examples of his wrath.
    —G.C. (Georg Christoph)

    No rules exist, and examples are simply life-savers answering the appeals of rules making vain attempts to exist.
    André Breton (1896–1966)

    In the examples that I here bring in of what I have [read], heard, done or said, I have refrained from daring to alter even the smallest and most indifferent circumstances. My conscience falsifies not an iota; for my knowledge I cannot answer.
    Michel de Montaigne (1533–1592)