Wednesday, May 11, 2016

ubuntu - How to measure total writes performed to SSD in Linux?

I've searched the internet to find a tool/utility which can tell me the total writes performed to an SSD (or a normal disk). The output should look something like this:



SSD Intel 320S :- 
Total data written until now -- 2Tb
Total data read until now -- 4Tb
power on Hours -- 1234 Hrs

etc.


But I haven't found one. Is anyone aware of such a tool?



I know the SSDLife tool on Windows does this, but I am specifically looking to do this on Linux.






I looked up the smartctl command from smartmontools suggested by Selivanov. His post has been very helpful. I am going to add more info here which I came across after digging the internet.




I found the gsmartcontrol (gui version of smartctrl) especially helpful. For more information about these class of tools check Smartmontools -- Community Ubuntu Documentation. This link has examples for smartctl.



To understand what each SMART attribute means check this Intel S.M.A.R.T Attributes. These attributes are specific to Intel SSDs, but nevertheless gives an idea, what kind of information SMART attributes convey. Some specific parameters may differ between different SSDs. Is LBA size one of them?, I don't know.



Another excellent information source is How to determine number of write cycles or expected life for SSD under Linux?. Here, the best answer shows the SMART Attribute Id 225 stands for the total write I/O in size of 32MiBs performed to the SSD until now. However, this applies to Intel X25-M. Other SSDs, may use other SMART attributes to convey total data written to disk.



Especially, for Samsung 840 Pro (and may be even for other Samsung SSDs?) SMART Attribute Id 241 -- Total LBAs Written conveys this information. My guess for the LBA size is 512bytes, but I am not sure? Some experiments I ran by writing set amount of data to the SSD and measuring this attribute's value indicates it is 512bytes.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...