1

No matter whether it's about UEFI, phones, or SSDs, Samsung apparently isn't particularly good at implementing standards. Unfortunately, some year ago, I bought a Samsung SSD 840 PRO Series SSD for my laptop which I have been using since (this was before all the info about their non-standard-conforming implementations were made public). It's a really nice SSD except for the asynchronous Trim which doesn't work properly, that is to say it deletes data it isn't supposed to delete. Because of this, Linux doesn't use Trim on it so people's data isn't lost (which happened before they disabled Trim on certain Samsung SSD models).

Because I've been using this SSD quite a lot: How strongly does disabled Trim impact the SSD's ability to do wear leveling?

I've not been able to find particularly good and reliable information in what the different attributes of SMART data means. Mainly people and articles basically guessing and contradicting themselves after a few sentences.

This Wikipedia article says:

Each drive manufacturer defines a set of attributes, and sets threshold values beyond which attributes should not pass under normal operation. Each attribute has a raw value, whose meaning is entirely up to the drive manufacturer (but often corresponds to counts or a physical unit, such as degrees Celsius or seconds), a normalized value, which ranges from 1 to 253 (with 1 representing the worst case and 253 representing the best) and a worst value, which represents the lowest recorded normalized value. The initial default value of attributes is 100 but can vary between manufacturer.

First off: How relevant is this given that its heading is "Known ATA S.M.A.R.T. attributes"? Does it apply to SSDs which are connected via SATA?

Why do the values range from 1 to 253? What's with 0, 254, and 255? Are values above 100 even used?

My SSD's SMART data looks like this (according to gnome-disks):

There are no values larger than 100.

I have many external HDDs but only this one SSD (which is an internal one) so I can't compare its SMART data with the ones of other SSDs I know the amount of usage off. But I suppose the raw value of my SSD's wear level count being 245 means that the SSD's storage cells have been written to 245 times on average. Please tell me whether that's correct, whether reads count, too, whether it's just 245 times the specified storage space (256 GB) or the specified storage space + the reserved storage space (to replace failed parts).

Does my SSD's normalized wear level count being 93 mean that it's almost two thirds through its life ({1, ..., 253}) or that it's pretty well off ({1, ..., 100})?

And one last question: Why does Linux disable Trim altogether with those SSDs if only asynchronous Trim causes data loss?

Output of $ sudo smartctl /dev/sda -a: http://pastebin.com/Prf7NzwN

Related question created by me in response to discussion in comments: https://unix.stackexchange.com/questions/333635/enabling-synchronous-trim-only

UTF-8
  • 678

2 Answers2

5

To answer the core question, yes, but your drive is suffering from suboptimal performance. (I've reposted the SMART data to GitHub Gist.)

Your SMART stats indicate that you've written 21.5 TiB to the drive (46248065971 total LBAs written, 512 bytes each). This is 86 full drive writes' worth of host writes (at 256 GiB of raw NAND). However, you've mentioned that the drive's underlying NAND has been written over 245 times. In other words, the drive has written nearly three times the data you've actually sent to the drive. This is called write amplification.

To explain what's going on, I'm going to summarize some of the content in another answer I've written. NAND flash memory consists of a series of blocks, each with a number of pages. Data can be written to individual pages but must be erased in whole blocks, and pages containing data cannot be rewritten until erased. To avoid unnecessarily erasing blocks and rewriting data, SSDs spread out writes across different blocks and mark the old data as invalid; the drive tries to avoid erasing blocks until all pages within each block are marked invalid. This breaks down without sufficient free pages available, in which case the drive is forced to erase blocks containing valid data and rewrite that data elsewhere in order to free up space for new data. Because this means that the same data is written to the underlying NAND more than once, this undesirable behavior is known as write amplification.

The lack of TRIM means that the drive will wind up treating deleted data as valid, reducing the amount of free space available to the drive. The drive ultimately winds up behaving as if it's completely full, even when it isn't.

To answer your question as written, the drive should continue to wear-level properly, distributing writes across the NAND to the extent possible. Knowing Samsung, I'd be very surprised if their algorithms didn't do this properly on a full drive. However, it's constantly rewriting data that it has already written, degrading performance and reducing endurance. Given that TRIM is not available, your best bet is to overprovision the drive, or allocate less than the full (256 GB) capacity for partitions (e.g. 200 GB). However, you'll need to secure-erase the drive for this to work, which means everything will have to be backed up first and restored afterwards. Given the limited capacity of the drive, I'm also not sure whether you're even able to reduce the partition size meaningfully without running yourself out of space.


As for your interpretation of the SMART data:

  • Yes, on Samsung and many other SSDs, the raw value for the wear leveling count is the average number of writes over all of the NAND on the drive. This does mean your drive's NAND has seen an average of 245 full write cycles. See Samsung SSD "Wear_Leveling_Count" meaning.
    • This is based on the raw NAND capacity, including any spare space.
    • Reads do not count towards this number (unless the SSD has to rewrite data due to read disturb).
  • The exact range for normalized values varies with the drive manufacturer, but on most drives, the wear leveling count is on a 0 to 100 range. Your drive is estimated to have about 93% of its write endurance remaining. Most of the other normalized values on this drive are on a 0 to 100 scale as well. (The NAND on the 840 PRO is good for about 3500 write cycles, and 245 cycles is 7% of that figure.)
  • The normalized attribute values 254 and 255 are considered reserved and should not appear on any drive.
bwDraco
  • 46,683
1

If a user writes some data to logical sector 12345, and an SSD controller happens to store that into physical block 4321, that doesn't mean that information will always reside in that block. Suppose that the user had written some data to logical sector 12346, and the system had also put that in physical block 4321, but later on the user wrote something else to logical sector 12346. At that point, physical block 4321 would hold a useful copy of what sector 12345 currently holds, and a useless copy of some data that sector 12346 had previously held. If there are many sectors that had been written to block 4321, but then had their logical contents replaced, the SSD controller may decide to copy all of the useful information from block 4321 to some other location and perform a bulk erase on block 4321 (which would be the only means by which the storage could ever be reused).

If before block 4321 was reclaimed, the SSD controller was informed that nobody would ever need the present contents of sector 12345, then the SSD controller could simply allow that information to vanish into the ether when the block is bulk-erased. If, however, the SSD controller was not informed that the block's contents were no longer needed, then the SSD controller would have to make a copy of the block somewhere else before bulk-erasing block 4321. While this extra copy operation wouldn't cause any harm aside from the time and energy spent performing it, and the slight wear it would cause to the chip, letting the controller know it need not bother copying the contents of a page when a block is reclaimed will improve performance, reduce power consumption, and reduce wear. A win-win-win.

supercat
  • 1,819
  • 10
  • 8