Is ssd wear confined to a partition?

Orig. posted on StackExchange, closed as off topic.

Suppose I have a SSD with a heavily-used 2GB swap partition, trimmed daily. Will the wear be confined to 2GB, or spread out over the entire SSD?

This answer by Anthony Schuijlenburg was downvoted; why? Is it inaccurate?

The ssd controller sees things on a whole other level than your OS. So with that said, if you use your 2gb partition a lot, the ssd controller will try to level that wear out across your entire ssd. So the awnser is no, it is not confined.


Solution 1:

Is ssd wear confined to a partition?

The short answer is:
No, because the SSD is unaware of what a partition is.


The simple answer is:
Partitioning of the storage drive is a software construct.
The partitioning scheme that the drive uses is stored on the drive itself (as data), typically in the first sector since that traditionally is an error-free sector.
Operating systems are expected to identify and respect the partitioning scheme implemented for each storage drive.

Partitioning of the storage drive is not supported by hardware.
The storage drive (HDD or SSD) at the hardware level has no concept of what a partition is.
The drive interface (ATA/ATAPI or SCSI) has no commands that reference or respect partition boundaries.
It is solely up to the OS and its filesystems (i.e. software) to respect partition boundaries.

There are storage devices that support partitioning at the hardware level, e.g. eMMC modules have boot partitions. But SSDs do not.


The technical answer is:
SSDs use a flash translation layer to implement wear leveling so that when a Logical Block Address (LBA aka sector) is (re)written, a different physical block is mapped to the LBA, and written with the new data.
The original physical block is marked as unused, and goes to the end of the available block list.
(Actually it's a bit more complicated because an erase operation is required before a block can be written, and the erase block is much larger than the sector block. Maintaining a supply of already-erased sectors available for remapping and writing is crucial for SSD performance.)

Since the SSD has no concept of partitions and there's a flash translation layer that maps LBAs to physical sectors, the list of physical sectors used by a partition could be distributed across the entire drive (plus hidden/spare blocks not reported as part of the drive's capacity).
As LBAs are (re)written, that list of physical sectors used by the partition will change.

Wear leveling could be restricted to a partition, for instance, in an embedded Linux system that uses JFFS2 on a NAND chip. In that case, wear leveling is part of that particular filesystem.
A PC does not use raw NAND chips for mass storage.
The SSD with its integrated controller uses a flash translation layer to emulate a HDD so that the OS can use a filesystem that is (almost) oblivious to NAND issues.
Consequently the NTL is at a lower layer than the partitioning scheme.
Hence the SSD's controller and the FTL have no concept of partitions, and therefore cannot restrict a drive operation (e.g. wear leveling) to a partition.