Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
badblocks(8)
Edit
PageHistory
Diff
Info
LikePages
BADBLOCKS !!!BADBLOCKS NAME SYNOPSIS DESCRIPTION OPTIONS WARNING AUTHOR AVAILABILITY SEE ALSO ---- !!NAME badblocks - search a device for bad blocks !!SYNOPSIS __badblocks__ [[ __-svwnf__ ] [[ __-b__ ''block-size'' ] [[ __-c__ ''blocks_at_once'' ] [[ __-i__ ''input_file'' ] [[ __-o__ ''output_file'' ] [[ __-p__ ''num_passes'' ] ''device'' [[ ''last-block'' ] [[ ''start-block'' ] !!DESCRIPTION __badblocks__ is used to search for bad blocks on a device (usually a disk partition). ''device'' is the special file corresponding to the device (e.g ''/dev/hdc1''). ''last-block'' is the last block to be checked; if it is not specified, the last block on the device is used as a default. ''start-block'' is an optional parameter specifying the starting block number for the test, which allows the testing to start in the middle of the disk. If it is not specified the first block on the disk is used as a default. __Important note:__ If the output of __badblocks__ is going to be fed to the __e2fsck__ or __mke2fs__ programs, it is important that the block size is properly specified, since the block numbers which are generated is very dependent on the block size in use. For this reason, it is strongly recommended that users __not__ run __badblocks__ directly, but rather use the __-c__ option of the __e2fsck__ and __mke2fs__ programs. !!OPTIONS __-b__ ''block-size'' Specify the size of blocks in bytes. __-c__ ''number of blocks'' is the number of blocks which are tested at a time. The default is 16. Increasing this number will increase the efficiency of __badblocks__ but also will increase its memory usage. __Badblocks__ needs memory proportional to the number of blocks tested at once, in read-only mode, proportional to twice that number in read-write mode, and proportional to three times that number in non-destructive read-write mode. If you set the number-of-blocks parameter to too high a value, __badblocks__ will exit almost immediately with an out-of-memory error __ __-f__ Normally, badblocks will refuse to do a read/write or a non-destructive test on a device which is mounted, since either can cause the system to potentially crash; even a non-destructive test can damage a mounted filesystem. This can be overriden using the __-f__ flag, but should almost never be used --- if you think you're smarter than the __badblocks__ program, you almost certainly aren't. The only time when this option might be safe to use is if the /etc/mtab file is incorrect, and the device really isn't mounted. __-i__ ''input_file'' Read a list of already existing known bad blocks. __Badblocks__ will skip testing these blocks since they are known to be bad. If ''input_file'' is specified as ''new'' bad blocks produced on the standard output or in the output file. The __-b__ option of dumpe2fs(8) can be used to retrieve the list of blocks currently marked bad on an existing filesystem, in a format suitable for use with this option. __-o__ ''output_file'' Write the list of bad blocks to the specified file. Without this option, __badblocks__ displays the list on its standard output. The format of this file is suitable for use by the __-l__ option in e2fsck(8) or mke2fs(8). __-p__ ''num_passes'' Repeat scanning the disk until there are no new blocks discovered in num_passes consecutive scans of the disk. Default is 0, meaning __badblocks__ will exit after the first pass. __-n__ Use non-destructive read-write mode. By default only a non-destructive read-only test is done. This option must not be combined with the __-w__ option, as they are mutually exclusive. __-s__ Show the progress of the scan by writing out the block numbers as they are checked. __-v__ Verbose mode. __-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. This option may not be combined with the __-n__ option, as they are mutually exclusive. !!WARNING Never use the __-w__ option on an device containing an existing file system. This option erases data! If you want to do write-mode testing on an existing file system, use the __-n__ option instead. It is slower, but it will preserve your data. !!AUTHOR __badblocks__ was written by Remy Card __ !!AVAILABILITY __badblocks__ is part of the e2fsprogs package and is available from http://e2fsprogs.sourceforge.net. !!SEE ALSO e2fsck(8), __mke2fs__(8) ----
8 pages link to
badblocks(8)
:
mke2fs(8)
mkfs(8)
mkfs.ext2(8)
mkfs.ext3(8)
Man8b
fsck.ext3(8)
e2fsck(8)
fsck.ext2(8)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.