Skip to main content
deleted 57 characters in body
Source Link
Jon Bentley
  • 500
  • 3
  • 8
  • 16

Upon reading the manpage further, I've solved the problem. -w does indeed do a single pass, as implied from the description of the -p option:

Default is 0, meaning badblocks will exit after the first pass.

A pass consists of four test patterns:

-w Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents.

The pattern can be overriden using the -t option:

-t test_pattern Specify a test pattern to be read (and written) to disk blocks. The test_pattern may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word "random", which specifies that the block should be filled with a random bit pattern. For read/write (-w) and non-destructive (-n) modes, one or more test patterns may be specified by specifying the -t option for each test pattern desired. For read-only mode only a single pattern may be specified and it may not be "random". Read-only testing with a pattern assumes that the specified pattern has previously been written to the disk - if not, large numbers of blocks will fail verification. If multiple patterns are specified then all blocks will be tested with one pattern before proceeding to the next pattern.


Example command:

badblocks -wsvt 0 /dev/sdz

Example and output:

# badblocks -wsvt 0 /dev/sdz
Checking for bad blocks in read-write mode
From block 0 to 488386583
Testing with pattern 0x00: done                                                 
Reading and comparing: done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)

Upon reading the manpage further, I've solved the problem. -w does indeed do a single pass, as implied from the description of the -p option:

Default is 0, meaning badblocks will exit after the first pass.

A pass consists of four test patterns:

-w Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents.

The pattern can be overriden using the -t option:

-t test_pattern Specify a test pattern to be read (and written) to disk blocks. The test_pattern may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word "random", which specifies that the block should be filled with a random bit pattern. For read/write (-w) and non-destructive (-n) modes, one or more test patterns may be specified by specifying the -t option for each test pattern desired. For read-only mode only a single pattern may be specified and it may not be "random". Read-only testing with a pattern assumes that the specified pattern has previously been written to the disk - if not, large numbers of blocks will fail verification. If multiple patterns are specified then all blocks will be tested with one pattern before proceeding to the next pattern.


Example command:

badblocks -wsvt 0 /dev/sdz

Example output:

# badblocks -wsvt 0 /dev/sdz
Checking for bad blocks in read-write mode
From block 0 to 488386583
Testing with pattern 0x00: done                                                 
Reading and comparing: done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)

Upon reading the manpage further, I've solved the problem. -w does indeed do a single pass, as implied from the description of the -p option:

Default is 0, meaning badblocks will exit after the first pass.

A pass consists of four test patterns:

-w Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents.

The pattern can be overriden using the -t option:

-t test_pattern Specify a test pattern to be read (and written) to disk blocks. The test_pattern may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word "random", which specifies that the block should be filled with a random bit pattern. For read/write (-w) and non-destructive (-n) modes, one or more test patterns may be specified by specifying the -t option for each test pattern desired. For read-only mode only a single pattern may be specified and it may not be "random". Read-only testing with a pattern assumes that the specified pattern has previously been written to the disk - if not, large numbers of blocks will fail verification. If multiple patterns are specified then all blocks will be tested with one pattern before proceeding to the next pattern.


Example command and output:

# badblocks -wsvt 0 /dev/sdz
Checking for bad blocks in read-write mode
From block 0 to 488386583
Testing with pattern 0x00: done                                                 
Reading and comparing: done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)
Changed example output to match example command and removed commentary
Source Link
Jon Bentley
  • 500
  • 3
  • 8
  • 16

Upon reading the manpage further, I've solved the problem. -w does indeed do a single pass, as implied from the description of the -p option:

Default is 0, meaning badblocks will exit after the first pass.

A pass consists of four test patterns:

-w Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents.

The pattern can be overriden using the -t option:

-t test_pattern Specify a test pattern to be read (and written) to disk blocks. The test_pattern may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word "random", which specifies that the block should be filled with a random bit pattern. For read/write (-w) and non-destructive (-n) modes, one or more test patterns may be specified by specifying the -t option for each test pattern desired. For read-only mode only a single pattern may be specified and it may not be "random". Read-only testing with a pattern assumes that the specified pattern has previously been written to the disk - if not, large numbers of blocks will fail verification. If multiple patterns are specified then all blocks will be tested with one pattern before proceeding to the next pattern.


Example command:

badblocks -wsvt 0 /dev/sdz

Example output:

# badblocks -wsvt 0 /dev/disk/by-id/ata-WDC_<model>-<serial>sdz
Checking for bad blocks in read-write mode
From block 0 to 488386583
Testing with pattern 0x00: done                                                 
Reading and comparing: done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)

Works as expected - confirmed!

Upon reading the manpage further, I've solved the problem. -w does indeed do a single pass, as implied from the description of the -p option:

Default is 0, meaning badblocks will exit after the first pass.

A pass consists of four test patterns:

-w Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents.

The pattern can be overriden using the -t option:

-t test_pattern Specify a test pattern to be read (and written) to disk blocks. The test_pattern may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word "random", which specifies that the block should be filled with a random bit pattern. For read/write (-w) and non-destructive (-n) modes, one or more test patterns may be specified by specifying the -t option for each test pattern desired. For read-only mode only a single pattern may be specified and it may not be "random". Read-only testing with a pattern assumes that the specified pattern has previously been written to the disk - if not, large numbers of blocks will fail verification. If multiple patterns are specified then all blocks will be tested with one pattern before proceeding to the next pattern.


Example command:

badblocks -wsvt 0 /dev/sdz

Example output:

# badblocks -wsvt 0 /dev/disk/by-id/ata-WDC_<model>-<serial>
Checking for bad blocks in read-write mode
From block 0 to 488386583
Testing with pattern 0x00: done                                                 
Reading and comparing: done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)

Works as expected - confirmed!

Upon reading the manpage further, I've solved the problem. -w does indeed do a single pass, as implied from the description of the -p option:

Default is 0, meaning badblocks will exit after the first pass.

A pass consists of four test patterns:

-w Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents.

The pattern can be overriden using the -t option:

-t test_pattern Specify a test pattern to be read (and written) to disk blocks. The test_pattern may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word "random", which specifies that the block should be filled with a random bit pattern. For read/write (-w) and non-destructive (-n) modes, one or more test patterns may be specified by specifying the -t option for each test pattern desired. For read-only mode only a single pattern may be specified and it may not be "random". Read-only testing with a pattern assumes that the specified pattern has previously been written to the disk - if not, large numbers of blocks will fail verification. If multiple patterns are specified then all blocks will be tested with one pattern before proceeding to the next pattern.


Example command:

badblocks -wsvt 0 /dev/sdz

Example output:

# badblocks -wsvt 0 /dev/sdz
Checking for bad blocks in read-write mode
From block 0 to 488386583
Testing with pattern 0x00: done                                                 
Reading and comparing: done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)
adding verbose switch might be a good idea + I tested it myself, and added _proof_, will flag all the disputes in comments as no longer needed
Source Link
Vlastimil Burián
  • 4.1k
  • 11
  • 45
  • 70

Upon reading the manpage further, I've solved the problem. -w does indeed do a single pass, as implied from the description of the -p option:

Default is 0, meaning badblocks will exit after the first pass.

A pass consists of four test patterns:

-w Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents.

The pattern can be overriden using the -t option:

-t test_pattern Specify a test pattern to be read (and written) to disk blocks. The test_pattern may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word "random", which specifies that the block should be filled with a random bit pattern. For read/write (-w) and non-destructive (-n) modes, one or more test patterns may be specified by specifying the -t option for each test pattern desired. For read-only mode only a single pattern may be specified and it may not be "random". Read-only testing with a pattern assumes that the specified pattern has previously been written to the disk - if not, large numbers of blocks will fail verification. If multiple patterns are specified then all blocks will be tested with one pattern before proceeding to the next pattern.


For exampleExample command:

badblocks -wstwsvt 0 /dev/sdz

Example output:

# badblocks -wsvt 0 /dev/disk/by-id/ata-WDC_<model>-<serial>
Checking for bad blocks in read-write mode
From block 0 to 488386583
Testing with pattern 0x00: done                                                 
Reading and comparing: done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)

Works as expected - confirmed!

Upon reading the manpage further, I've solved the problem. -w does indeed do a single pass, as implied from the description of the -p option:

Default is 0, meaning badblocks will exit after the first pass.

A pass consists of four test patterns:

-w Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents.

The pattern can be overriden using the -t option:

-t test_pattern Specify a test pattern to be read (and written) to disk blocks. The test_pattern may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word "random", which specifies that the block should be filled with a random bit pattern. For read/write (-w) and non-destructive (-n) modes, one or more test patterns may be specified by specifying the -t option for each test pattern desired. For read-only mode only a single pattern may be specified and it may not be "random". Read-only testing with a pattern assumes that the specified pattern has previously been written to the disk - if not, large numbers of blocks will fail verification. If multiple patterns are specified then all blocks will be tested with one pattern before proceeding to the next pattern.


For example:

badblocks -wst 0 /dev/sdz

Upon reading the manpage further, I've solved the problem. -w does indeed do a single pass, as implied from the description of the -p option:

Default is 0, meaning badblocks will exit after the first pass.

A pass consists of four test patterns:

-w Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents.

The pattern can be overriden using the -t option:

-t test_pattern Specify a test pattern to be read (and written) to disk blocks. The test_pattern may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word "random", which specifies that the block should be filled with a random bit pattern. For read/write (-w) and non-destructive (-n) modes, one or more test patterns may be specified by specifying the -t option for each test pattern desired. For read-only mode only a single pattern may be specified and it may not be "random". Read-only testing with a pattern assumes that the specified pattern has previously been written to the disk - if not, large numbers of blocks will fail verification. If multiple patterns are specified then all blocks will be tested with one pattern before proceeding to the next pattern.


Example command:

badblocks -wsvt 0 /dev/sdz

Example output:

# badblocks -wsvt 0 /dev/disk/by-id/ata-WDC_<model>-<serial>
Checking for bad blocks in read-write mode
From block 0 to 488386583
Testing with pattern 0x00: done                                                 
Reading and comparing: done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)

Works as expected - confirmed!

/dev/sdb1 does make no sence to me, one shall never do a "destructive scan" with a partition, I edited the line to aim on the whole disk + someone could run the command not really reading upon the `-w` manual, so I changed it the drive "letter" to `z`, less chance for mistakes, cheers
Source Link
Vlastimil Burián
  • 4.1k
  • 11
  • 45
  • 70
Loading
Please look at the comments or the manpage; added quote for clearance
Source Link
Jon Bentley
  • 500
  • 3
  • 8
  • 16
Loading
Please look at the comments or the manpage; added quote for clearance
Source Link
Loading
deleted 2 characters in body
Source Link
Jon Bentley
  • 500
  • 3
  • 8
  • 16
Loading
Source Link
Jon Bentley
  • 500
  • 3
  • 8
  • 16
Loading