DISKSCAN(1)
π DISKSCAN β the diskscan(1) page, but make it make sense π
okay bestie, so you know how your disk can start acting sus before it fully gives up the ghost? this is the tool that catches that. it's diskscan, from the User Commands section of the manual, and it's here to do a lil health check on your drive before things get tragic. π©Ίβ¨
πΈ NAME πΈ
diskscan β scan a disk for failed and near failure sectors
π SYNOPSIS π
diskscan [options...] block_device
β¨ DESCRIPTION β¨
so here's the tea: diskscan is built to check a disk and find any bad sectors that are already there, plus assess whether there are any sectors that are lowkey in the process of going bad. π and the best part? the whole operation is all read-only β it can cause no direct damage to the data on your disk. no cap. your data is safe, we're just looking. π
the way it works is it reads the entire block device and notes how long it took to read a block. when there's an error it gets noted immediately, and also when there's a higher latency to read a block. then it gives you a histogram of the block latency times so you can assess the health of the disk. it's giving doctor's report but for your drive. π«Ά
the output will show any serious errors or very high latency, and it'll also emit a histogram at the end of the run, in this form:
I: Validating path /dev/sdg
I: Opened disk /dev/sdg
I: Scanning disk /dev/sdg
Access time histogram:
1: 0
10: 0
100: 0
500: 120
1000: 0
2000: 1
3000: 0
4000: 0
5000: 0
6000: 0
7000: 0
8000: 0
9000: 0
10000: 0
15000: 0
20000: 0
25000: 0
30000: 0
above that: 0
I: Closed disk /dev/sdg
so what does that mean? it means all I/Os in this case were between 100 and 600 msec, and there were 120 chunks being read. currently these chunks are 1MB in size. icon behavior from that disk honestly. π
π OPTIONS π
-v,--verboseβ display verbose information from the workings of the scan. use it multiple times for increased verbosity. yes bestie, stack it, it's multiplicative energy. π₯-f,--fixβ attempt to fix areas that are nearing failure. this should only be attempted on an unmounted block device and never on an in-use filesystem or corruption is likely. π¨ seriously, do NOT run this on something that's mounted, that's the whole warning.-s<mode>,--scan<mode>β scan mode can be eitherseqorrandom.randomreduces the chance that the disk will be able to spend time to recover data before we try to access a sector, but the seeks add noise to the latency measurement. Sequential test is the default, and random test is still experimental with regard to its usefulness. π§ͺ-e<size>,--size<size>β set the size in which the scan will be done. this must be a multiple of the sector size, which is normally512bytes.-o<file>,--output<file>β set the output file that the scan will generate. this is aJSONfile with the summary and details about the exceptional events found during the scan. π-r<file>,--raw-log<file>β set the output file for the raw log, which logs everything done and seen during the scan. this is a rather large file, but it can help get the finer details of the scan progress and the disk behavior during the scan. this is too aJSONfile. ποΈ
π SEE ALSO π
badblocks(1), fsck(1)
π AUTHOR π
Baruch Even <baruch@ev-en.org>
okay that's the whole page bestie, every last flag accounted for, not one detail dropped, periodt. π
sign-off cuteness: this was DiskScan 0.19, dated 2013-10-25 β a vintage queen, still eating. π β¨ go check your disks, love you, bye! π¦
π¦ where this page comes from
- debian trixie: diskscan 0.21-1 Β· GPL-3.0-or-later
- nixos 26.05: diskscan 0.21
- nixpkgs unstable: diskscan 0.21
- opensuse-leap 16.0: diskscan 0.21-bp160.1.6 Β· GPL-3.0-or-later
- opensuse-leap 16.0: diskscan 0.21-bp160.1.6 Β· GPL-3.0-or-later
- opensuse-leap 16.0: diskscan 0.21-bp160.1.6 Β· GPL-3.0-or-later
- opensuse-leap 16.0: diskscan 0.21-bp160.1.6 Β· GPL-3.0-or-later
- ubuntu questing: diskscan 0.21-1
- ubuntu resolute: diskscan 0.21-2 Β· GPL-3.0-or-later
- ubuntu stonking: diskscan 0.21-2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms