Scan disk for bad or near failure sectors, performs disk diagnostics
C C++ Python CMake Objective-C Shell Makefile
Latest commit cd596a1 Apr 12, 2017 @baruch Reduce timeout for IOs
Use 5 seconds for diagnostic IOs (read cap, ata identify, etc.)

Use 1 minute for data IOs, should be long enough to be safe for media
errors and not too long to bore the user when there are many errors.

Related to #58
Failed to load latest commit information.
Documentation Output JSON log files Nov 20, 2013
arch Reduce timeout for IOs Apr 12, 2017
cli Implement partition mount verification Nov 15, 2015
hdrhistogram Fix build on FreeBSD Oct 30, 2015
include Implement partition mount verification Nov 15, 2015
libscsicmd Merge commit 'e64269c521429d942c67841305a2750f55000910' Nov 6, 2015
progressbar Fix build of progressbar on non-stdc99 compilers Oct 9, 2015
.gitignore Switch to cmake as build system Oct 27, 2015
.travis.yml Build the manpage properly Nov 6, 2015
CMakeLists.txt Prepare to release version 0.19 Nov 15, 2015
COPYING License DiskScan under the GPLv3 Sep 19, 2013 Update dependencies needed in Nov 5, 2015
diskscan.c License DiskScan under the GPLv3 Sep 19, 2013 Add Nov 14, 2015

DiskScan -- Scan HDD/SSD for failed and near failed sectors

Build Status ![Gitter]( Chat.svg)

DiskScan is a Unix/Linux tool to scan a block device and check if there are unreadable sectors, in addition it uses read latency times as an assessment for a near failure as sectors that are problematic to read usually entail many retries. This can be used to assess the state of the disk and maybe decide on a replacement in advance to its imminent failure. The disk self test may or may not pick up on such clues depending on the disk vendor decision making logic.

diskscan vs. badblocks

badblocks is intended for a simple task, to find bad blocks in the media. diskscan is trying to say a lot more about the media, specifically it is trying not just to say where is a bad block but also what blocks are already deteriorated but still readable and also give information on the latency of reading each block which should help to give an overall assessment of the disk media.

In essence badblocks looks for fatal issues already happening and diskscan is for upcoming issues that can be fixed.

Also, badblocks is essentially obsolete in this day and age since the disks themselves will reallocate the data and there is no real need to map the bad blocks in the filesystem level anymore.


This project is using CMake, on Debian/Ubuntu it is as simple as: apt-get install cmake make libtinfo-dev libncurses5-dev zlib1g-dev python-yaml

For RedHat/SuSe based distros you need to install ninja-build first and then: yum install compat-libtermcap libtermcap-devel cmake python-yaml zlib-devel

A Makefile is provided to avoid learning the ninja commands and do the non-build stuff (install, etc.)

To do the build:

cmake . && make


make install

You can control the DESTDIR when building packages and PREFIX if /usr is not right.


diskscan is licensed under the GPL version 3 or later.