# Does Smartctl Selftest Involves Read/Write Operations on the disk itself?



## shinx (Jan 30, 2019)

Hi all, please correct me if this is not the right place to post this question.

I would like to know if smartctl self-test involves some read/write operations on the disk itself.

From what I understand from the Wikipedia, it does involves read/write operations.



> Short - Checks the electrical and mechanical performance as well as the read performance of the disk. Electrical tests might include a test of buffer RAM, a *read/write* circuitry test, or a test of the *read/write* head elements. Mechanical test includes seeking and servo on data tracks. Scans small parts of the drive's surface (area is vendor-specific and there is a time limit on the test). Checks the list of pending sectors that may have read errors, and it usually takes under two minutes.
> 
> Long/extended - A longer and more thorough version of the short self-test, scanning the entire disk surface with no time limit. This test usually takes several hours, depending on the *read/write* speed of the drive and its size.



However, when I run a short/long test on the drive itself. I do not see any iops on the disk from the `gstat`


```
$ sudo smartctl -l selftest /dev/da0
smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.2-STABLE amd64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
Self-test execution status:             68% of test remaining
SMART Self-test log
Num  Test              Status                 segment  LifeTime  LBA_first_err [SK ASC ASQ]
     Description                              number   (hours)
# 1  Background long   Self test in progress ...   -     NOW                 - [-   -    -]
# 2  Background long   Completed                   -   14148                 - [-   -    -]
# 3  Background short  Completed                   -   14128                 - [-   -    -]

Long (extended) Self Test duration: 39236 seconds [653.9 minutes]
```


```
dT: 0.002s  w: 1.000s  filter: da0
 L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w    d/s   kBps   ms/d   %busy Name
    0      0      0      0    0.0      0      0    0.0      0      0    0.0    0.0| da0
```

Thanks in advance.


----------



## SirDice (Jan 30, 2019)

shinx said:


> I do not see any iops on the disk from the  gstat


It's done by the drive's firmware internally. So there's never any data going in or out of the drive's interface. Hence gstat(8) doesn't "see" it.


----------



## shinx (Jan 31, 2019)

Ok.
But, will it affect the performance of the disk if I run a SHORT/LONG Self-test on a running disk with high IOPS?


----------



## SirDice (Jan 31, 2019)

shinx said:


> But, will it affect the performance of the disk if I run a SHORT/LONG Self-test on a running disk with high IOPS?


Never done any real tests but I would say yes. With the short tests probably not that much, the long tests might have some noticeable impact though. Although I do think you would need to have a 'normal' load that's close to the maximum IOPS the drive could push before you would actually notice it.


----------



## VladiBG (Jan 31, 2019)

http://www.t10.org/ftp/t10/document.99/99-179r0.pdf


----------

