![linux disk health linux disk health](https://www.wikihow.com/images/9/9c/Format-a-Linux-Hard-Disk-to-Windows-Step-12.jpg)
Ideally, this leads to an increase in speed. SSDs, on the other hand, distribute write accesses more efficiently across storage blocks. This technology makes it possible for the hard disk to sort queries from the system in such a way that the heads take the shortest possible path. On newer hard disks, you should check whether Native Command Queuing (NCQ) is to be found under Commands/features. Owners of an SSD especially can find out quickly whether they are running the current firmware version. The designation and firmware version number are always listed at the top under Model Number and Firmware Revision. The information that hdparm delivers is dependent on the device. USB-to-IDE adapters often cause problems because they do not transmit the (complete) ATA or ATAPI commands to the drive. Hdparm accepts any device as mass storage that is connected to an (E)IDE, SATA, or SAS interface, including, therefore, DVD drives and SSDs. The | more option makes sure the large amount of information does not simply rush unread through the terminal.
![linux disk health linux disk health](https://www.ghacks.net/wp-content/uploads/2017/07/smartmontools-capabilities.png)
The tool will deliver all available data about the chosen drive – in this case, the first hard disk sda. With spinning disks, there are 2 important lines which are ‘Reallocated_Sector_Ct’ and ‘Current_Pending_Sector’ count, the reallocated sector count means you have bad sectors but the disk has dealt with them fine, this is not terrible if the count is either low <1000 or static and not growing over time if however you have Current_Pending_Sectors for more than 24 hours that means the disk has issues and it cannot deal with them itself, this is critical.Figure 1: Hdparm lists the hardware properties of a six-year-old hard disk with a 320GB capacity. You can then check the disk health with: #smatctl -a /dev/sda With spinning disks let us again assume that the disk is /dev/sda you can run a short or a long test as follows: #smartctl -t short -a /dev/sda (This is a short self test) To see the overall health you can check the ‘Wear_leveling_count’ line, this starts at 100 and reduces down to 0, again this is simply a vendor estimate of the % of the remaining life of the disk if you are getting filesystem issues and slow performance then the disk may be at the end of its best days. You are then looking for any specific errors logged at the end which will be very obvious and titled as errors, if you find these please copy and paste them into a ticket for us to review. #smartctl -t long -a /dev/sda (This is a long self test) With SSD’s you can use the regular smart tests, assuming that the disk is /dev/sda you can run a short or a long test as follows: #smartctl -t short -a /dev/sda (This is a short self test) It is however VERY important to keep in mind that you can be at 100% and still see no issues with the disk, this is simply a vendor estimate of the % of the remaining life of the disk if you are getting filesystem issues and slow performance then the disk may be at the end of its best days. The closer to 100% you get the more your disk is close to the end of its predicted life. Now we know the disk is nvme0 we can check its health: Node SN Model Namespace Usage Format FW Rev You will see a list of NVMe disks: # nvme list
![linux disk health linux disk health](https://www.howtogeek.com/thumbcache/280/160/20f5f87dfaaa9c7437ba037a22b987a0/wp-content/uploads/2006/10/WindowsLiveWriter/CheckyourDiskUsageonUbuntuwithDiskUsageA_AB79/diskusagemenu1.png)
LINUX DISK HEALTH INSTALL
If you do not have this installed use your package manager to install ‘nvme-cli’, you will also need ‘smartmontools’ It is a good idea to do regular checks of your server disks, however with a number of disk types now, Spinning HDD’s SSD’s and NVMe disks there are different ways to check them, this guide is intended to give you indications only it is not black and white between good and bad disks.