首页
首页 » 磁盘维护 » badblocks

badblocks

badblocks
功能说明:检查磁盘装置中损坏的区块。
语  法:badblocks [-svw][-b <区块大小>][-o <输出文件>][磁盘装置][磁盘区块数][启始区块]
补充说明:执行指令时须指定所要检查的磁盘装置,及此装置的磁盘区块数。
参  数:
  -b<区块大小>   指定磁盘的区块大小,单位为字节。
  -o<输出文件>   将检查的结果写入指定的输出文件。
  -s   在检查时显示进度。
  -v   执行时显示详细的信息。
  -w   在检查时,执行写入测试。
  [磁盘装置]   指定要检查的磁盘装置。
  [磁盘区块数]   指定磁盘装置的区块总数。
  [启始区块]   指定要从哪个区块开始检查。

badblocks

badblocks [options] device block-count

System administration command. Search device for bad blocks. You must specify the number of blocks on the device (block-count). e2fsck and mke2fs will invoke badblocks automatically when given the -c option.

Options

-b blocksize

Expect blocksize-byte blocks.

-c blocksize

Test blocksize-byte blocks at a time. Default is 16.

-f

Force a read/write or nondestructive write test on a mounted device. Use only when /etc/mtab incorrectly reports a device as mounted.

-i file

Skip test of known bad blocks listed in file.

-n

Perform a nondestructive test by writing to each block and then reading back from it while preserving data.

-o file

Direct output to file.

-p number

Repeat search of device until no new bad blocks have been found in number passes. Default is 0.

-s

Show block numbers as they are checked.

-t pattern

Test blocks by reading and writing the specified pattern. You may specify pattern as a positive integer or as the word random. If you specifiy multiple patterns, badblocks will test all blocks with one pattern, and then test all blocks again with the next pattern. Read-only mode will accept only one pattern. It will not accept random.

-v

Verbose mode.

-w

Test by writing to each block and then reading back from it.