Does it make sense to defrag a SSD?
-
The trim command was introduced with win 7 iirc
Wrong is evil and must be defeated. - Jeff Ello
-
Even magnetic disks do low level reallocation of blocks when a bad block is detected. The disk addresses appear continuous, but one or more blocks may be physically located in a different location. On a magnetic disk, this of course affects average access time. Probably less than you would think. SSDs always do a physical layer 'reallocation' (which is really an allocation, without the re), below the disk address level, to even out wear, so that the same physical blocks are not used again and again, but new writes are distributed among all free blocks. I would be very surprised if this allocation mechanism wouldn't handle bad pages as well. What would make sense on an SSD is if the disk driver kept track of blocks in read-only files, written once and later only read. If the disk is 90% full, and other files come and go, even with wear leveling the remaining 10% of the blocks may have been written 50,000 times. It would make sense to move read-only files into this area, to provide a 'virgin' area for the next million block writes. (I never heard of any SSD disk doing this, but maybe some of them do.)
"below the disk address level, to even out wear, so that the same physical blocks are not used again and again, but new writes are distributed among all free blocks. I would be very surprised if this allocation mechanism wouldn't handle bad pages as well. " Yeah... that bit is what I thought TRIM was doing. Defrag just does that now if it is pointed at an SSD? But I think so does windows now without you specifically messing with it.
-
jochance wrote:
The reason it matters to an SSD is because when an SSD gets heavily fragmented, what it can mean is much faster wear and tear on the drive.
As quite a few links indicate (posted here and when googled) describe what happens for a SSD. With the older hard disk drives there was a physical spinning platter. Thus 'wear and tear' as the arm switched back and forth over the various tracks. With an SSD there is no arm to move. Addressing is direct.
-
jschell wrote:
Thus 'wear and tear' as the arm switched back and forth over the various tracks.
I never ever heard of a disk with a worn out arm. (Nor of a loudspeaker with a worn out voice coil - the mechanisms are similar. The speaker has probably made magnitudes more back-and-forth moves.) There is no physical contact between the arm/head and the platter, and no physical wear from long use.
With an SSD there is no arm to move. Addressing is direct.
Down to some level. While a magnet can be flipped one way or the other a more or less unlimited number of times, a cell in an SSD is worn out with repeated writes. A good rule-of-thumb used to be 100.000 writes; some people said that was overly optimistic. Technology may have improved, but still all SSDs use some kind of wear leveling: There is a mapping to physical blocks, so that writing is spread evenly on the free blocks. The external address you use when writing a block does not map directly to one physical location on the SSD.
-
Saw an article this morning recommending that you run the command: "Defrag C:" from time to time on your SSD drives. But does it make sense to defrag a SSD? I can understand that it is of value on old spinning disk hard drives, where fragmentation can cause the reader to physically jump from fragment to fragment, but a SSD has no moving parts. What do the experts say?
Ok, I have had my coffee, so you can all come out now!
No, it's utter nonsense. For at least two reasons. For one, assuming you are running a recent Windows, NTFS isn't prone to fragmentation anymore in the way FAT used to be in the days of old. And second, you are just wasting write cycles on that SSD (which are still limited below the lifetime of a "spinning rust" drive) for little gain, if any at all.
-
Saw an article this morning recommending that you run the command: "Defrag C:" from time to time on your SSD drives. But does it make sense to defrag a SSD? I can understand that it is of value on old spinning disk hard drives, where fragmentation can cause the reader to physically jump from fragment to fragment, but a SSD has no moving parts. What do the experts say?
Ok, I have had my coffee, so you can all come out now!
Doesn't Windows itself refuse to defrag a SSD? Try running Windows defrag on SSD and it will simply do some 'trimming', and won't show any fragmentation status. That should be clear answer. A maker of OS should know best.
-
Doesn't Windows itself refuse to defrag a SSD? Try running Windows defrag on SSD and it will simply do some 'trimming', and won't show any fragmentation status. That should be clear answer. A maker of OS should know best.
Try this: Run defrag c: from an elevated command prompt. Be patient, it takes quite a while, and you get: Pre-Optimization Report: Volume Information: Volume size = 930.65 GB Free space = 868.64 GB Total fragmented space = 20% Largest free space size = 863.72 GB Note: File fragments larger than 64MB are not included in the fragmentation statistics. The operation completed successfully. Post Defragmentation Report: Volume Information: Volume size = 930.65 GB Free space = 868.64 GB Total fragmented space = 0% Largest free space size = 863.75 GB Note: File fragments larger than 64MB are not included in the fragmentation statistics.
Ok, I have had my coffee, so you can all come out now!
-
jschell wrote:
Thus 'wear and tear' as the arm switched back and forth over the various tracks.
I never ever heard of a disk with a worn out arm. (Nor of a loudspeaker with a worn out voice coil - the mechanisms are similar. The speaker has probably made magnitudes more back-and-forth moves.) There is no physical contact between the arm/head and the platter, and no physical wear from long use.
With an SSD there is no arm to move. Addressing is direct.
Down to some level. While a magnet can be flipped one way or the other a more or less unlimited number of times, a cell in an SSD is worn out with repeated writes. A good rule-of-thumb used to be 100.000 writes; some people said that was overly optimistic. Technology may have improved, but still all SSDs use some kind of wear leveling: There is a mapping to physical blocks, so that writing is spread evenly on the free blocks. The external address you use when writing a block does not map directly to one physical location on the SSD.
trønderen wrote:
There is no physical contact between the arm/head and the platter, and no physical wear from long use.
Nor did I claim that. The arm moves. Thus the mechanical action itself requires...mechanics. Which do in fact wear out. https://www.reddit.com/r/AskElectronics/comments/18gn8l/hard_drive_arm_failed_any_suggestions_besides/[^]
trønderen wrote:
a cell in an SSD is worn out with repeated writes.
Again not something I said. A traditional hard drive platter can wear out due to read/writes. That is especially true when the technology was first introduced. However accessing the location has nothing to do with that. Not in a SSD and not in the traditional hard drive. As I stated with the traditional hard drive there is a arm that moves. In a SSD there is not.
-
trønderen wrote:
There is no physical contact between the arm/head and the platter, and no physical wear from long use.
Nor did I claim that. The arm moves. Thus the mechanical action itself requires...mechanics. Which do in fact wear out. https://www.reddit.com/r/AskElectronics/comments/18gn8l/hard_drive_arm_failed_any_suggestions_besides/[^]
trønderen wrote:
a cell in an SSD is worn out with repeated writes.
Again not something I said. A traditional hard drive platter can wear out due to read/writes. That is especially true when the technology was first introduced. However accessing the location has nothing to do with that. Not in a SSD and not in the traditional hard drive. As I stated with the traditional hard drive there is a arm that moves. In a SSD there is not.
jschell wrote:
trønderen wrote:There is no physical contact between the arm/head and the platter, and no physical wear from long use. Nor did I claim that.
Nor was it my intention to repeat what you said, but to add information. I have never before heard of a disk arm "wearing out". If this was a problem, disks that have been operating for many, many years should have broken down a long time ago due to arm failure. You don't hear much of that! (*) Also, the failure of a disk arm is not necessarily a result of mechanical wear. It could be e.g. an electronics failure, dirt entering into the mechanical parts, deformation due to mechanical shock (dropping the disk to the floor etc.) or a number of other reasons. The person reporting this problem reports how much the disk arm moves back and forth 1/4 of an inch. You cannot see that without opening the disk. That makes me somewhat suspicious. I would never trust a disk that has been opened up by an amateur.
trønderen wrote:a cell in an SSD is worn out with repeated writes. Again not something I said.
Again, I didn't intend to repeat what you said, but to add information. (*) A disk arm is operated very much like a loudspeaker cone. A history from a while back: One of my study mates had ordered a really powerful audio amplifier, and a set of large speakers. The amp arrived before the speakers, so he tried out the amp with his old, small speakers. This guy was into classical music, and he reported that when playing the "1812 Overture", when the cannons were fired, he had smoke effects from his speakers. If you could directly control the power applied to your disk arm, you could possibly have it provide similar smoke effects. But you cannot, unless you really set out with determined wish to destroy your disk unit.
-
Saw an article this morning recommending that you run the command: "Defrag C:" from time to time on your SSD drives. But does it make sense to defrag a SSD? I can understand that it is of value on old spinning disk hard drives, where fragmentation can cause the reader to physically jump from fragment to fragment, but a SSD has no moving parts. What do the experts say?
Ok, I have had my coffee, so you can all come out now!
Short answer: No. Long answer: Unlike mechanical drives, data blocks aren't stored physically in the same order as they are logically. Blocks are physically fragmented internally in most cases, regardless (including what order the OS believes them to be in). But this doesn't matter, since all blocks are accessed at the same speed (**), eliminating any speed advantage of sequential access (++). ** Hypothetically, a high end drive could read/write multiple physical flash chips simultaneously, allowing a block to be accessed without waiting for a prior one to finish, if stored on a different chip. ++ Some Flash Translation Layer (FTL) structures may have a slight speed advantage from accessing co-located logical blocks (such as unfragmented reads). But the speed improvement would be trivial compared to the speed increase of sequential access of mechanical drives. While a given manufacture's implementation may vary, the mapping of blocks generally works something like describe on one of these pages: Overview of SSD Structure and Basic Working Principle(2) Coding for SSDs – Part 3: Pages, Blocks, and the Flash Translation Layer | Code Capsule