Почему вы не можете дефрагментировать твердотельные накопители?

13597
George IV

Я продолжаю слышать, что это огромное нет-нет. Почему это? В основном я использую Ubuntu, так что это не влияет на меня, но мне было просто интересно.

39
Я не могу сказать, что я получил образование в этой области, но я полагаю, что это потому, что SSD-накопители слегка повреждаются каждый раз, когда они выполняют запись, а дефрагментация изнашивает SSD быстрее. Кроме того, поскольку SSD не имеют движущихся частей, дефрагментация SSD дает меньший выигрыш в производительности, чем дефрагментация HDD. Blixt 14 лет назад 4
Примечание для читателей, приземляющихся на этой странице: мышление на эту тему изменилось за 7 с половиной лет после того, как этот вопрос был задан. Обязательно посмотрите последние ответы здесь и ответы на текущий вопрос, который помечен как дубликат. fixer1234 7 лет назад 1

8 ответов на вопрос

63
chills42

Твердотельные накопители основаны на флэш-памяти, срок службы которой сильно отличается от стандартных жестких дисков на основе вращающегося диска . Каждый сектор имеет ограниченное количество циклов записи, поэтому накопители имеют функции выравнивания износа, которые позволяют накопителю работать дольше, по сути, специально его фрагментируя.

Время чтения не значительно улучшается при дефрагментации, как в стандартных дисках, поэтому при дефрагментации нет реальной выгоды, но при этом вы увеличиваете количество операций записи на диск, тем самым сокращая срок службы диска.

45
Jeff Moser

Дефрагментация размещает ваши сектора рядом друг с другом, что полезно для вращающегося диска. Однако это бесполезно на SSD, который имеет постоянное время доступа для любого сектора. Дефрагментация просто вызывает дополнительные записи на диск (SSD имеют ограниченное количество записей из-за их дизайна)

11
Lasse Vågsæther Karlsen

Обратите внимание, что не должно быть никаких технических причин для того, чтобы «не иметь возможности дефрагментировать твердотельный накопитель», в том смысле, что вы можете запустить программу дефрагментации и запустить ее на накопителе.

Но это не влияет на работу твердотельных накопителей, поскольку перемещение кластеров на самом деле не ускоряет работу накопителя.

С другой стороны, вы будете выполнять множество ненужных операций записи на диск, и это, хотя и немного, сократит срок службы диска.

Кроме того, многие твердотельные накопители выполняют оптимизацию, чтобы уменьшить эту проблему, уменьшая повторные записи в одну и ту же область, и это прозрачно для внешней системы, и в этом случае кластеры могут вообще не перемещаться вместе, а вместо этого распределяться по диску., Эта техника, как правило, "выравнивание износа".

Если программа дефрагментации отказывается дефрагментировать твердотельный диск (или даже просто указать его как диск, который вы можете выбрать), я бы поспорил, что это в основном отказ программного обеспечения, просто чтобы избежать проблем, описанных выше.

Обратите внимание, что я недостаточно знаю о базовых протоколах, используемых для дефрагментации диска, поэтому вполне может быть жесткий блок с твердотельного диска для приема команд дефрагментации, если такие вещи существуют. Причины этого, однако, описаны ниже.

SSD = твердотельный накопитель. Там нет диска. Вы продолжаете использовать «диск» вместо «диск». sawdust 8 лет назад 1
7
TheTXI

Дефрагментация снизит ожидаемый срок службы вашего накопителя, выполняя ненужные проходы над накопителем с ограниченным сроком службы.

2
Synetech

It depends on what is on the drive. You will not get any performance increase by defragging an SSD, but it will have an impact on data-recovery.

On the one hand, flash-memory has a limited number of write cycles, so doing a lot of writing will eventually wear it out. Flash drives, memory cards, and SSDs use tricks like wear-leveling and TRIM to extend the life of the media, but defragmentation tends to cause a large number of writes, which will cause it wear out all the faster.

On the other hand, fragmented files are infinitely harder to recover when accidentally deleted, hit by a virus, etc. so keeping your files in a contiguous state (e.g., by defragmenting) will greatly increase the chances of recovery.

Therefore, like I said at the start, it depends on what is stored on the drive, how important the files are, how likely you are to need to perform data-recovery, and how frequently the files are changed (frequent deletions and copies will lead to fragmentation faster as well as eat up more write cycles).

2
peterh

Actually, you can. Defragmentation is a filesystem-level thing, it doesn't matter what is on the lower, block level.

But in the case of the SSD there is no disk head whose movements should be minimized. Thus, it won't be faster, not even a little bit.

Some OSes and tools forbid this only, because the decisions of their developer companies like to mix the meaning of "you don't need" and "you can't". But these are different things.

Probably there are multiple hacks which could avoid this ban (regedit, or exporting the drive as iscsi and re-importing to the same machine, etc). In this case, you will find a very fragmented drive, whose defrag will be very long. It is because the OS doesn't care about fragmentation on their case. And, as other answers also mention, this defrag won't make your system faster, but it will reduce its life.

Правда. Вы можете дефрагментировать файловую систему на SSD. А что касается ОС, теперь у вас есть хорошие чистые последовательные данные. (Все это очень не соответствует действительности на реальном диске, который выполняет его внутреннее сопоставление). Hennes 8 лет назад 0
2
magicandre1981

It is not bad all the time. Manually running a full defragmentation is something you should not do, but if you have volume snapshots are enabled, windows 8/10 will defrag the SSD once per month:

This is by design and necessary due to slow volsnap copy on write performance on fragmented SSD volumes. It’s also somewhat of a misconception that fragmentation is not a problem on SSDs. If an SSD gets too fragmented you can hit maximum file fragmentation (when the metadata can’t represent any more file fragments) which will result in errors when you try to write/extend a file. Furthermore, more file fragments means more metadata to process while reading/writing a file, which can lead to slower performance.

Conclusion

No, Windows is not foolishly or blindly running a defrag on your SSD every night, and no, Windows defrag isn't shortening the life of your SSD unnecessarily. Modern SSDs don't work the same way that we are used to with traditional hard drives.

Yes, your SSD's file system sometimes needs a kind of defragmentation and that's handled by Windows, monthly by default, when appropriate. The intent is to maximize performance and a long life. If you disable defragmentation completely, you are taking a risk that your filesystem metadata could reach maximum fragmentation and get you potentially in trouble.

1
Simon

According to Condusiv Technologies:

SSDs start out really fast and then quickly start to lose their speed and over time become subject to corruption. SSDs require that old data be erased before new data is written over it, rather than just writing over the old information like with hard drives. This doubles the wear and tear and can cause major issues.

The principle issue is write speed degradation due to free space fragmentation. Small free spaces scattered across the SSD cause the file system to write a file in fragmented pieces to those small available free spaces. By doing so, it degrades write performance by as much as 80% to the solid state drive.

SSDs can only write so many times to the drive as they have a finite number of writes that they can perform. Due to the doubling effect of needing to read and erase before it can write again, SSDs undergo twice as much use.

As the SSD approaches its limit, more fragmentation and write errors occur, causing SSD slows. Write performance decreases proportionately as free space fragmentation increases. All SSDs will suffer from this problem at one point or another unless HyperFast is used to optimize the solid state drive.

They therefore recommend using their product called Diskeeper.Accoding to the company:

Diskeeper with HyperFast keeps your system running as fast as when you purchased it, by optimizing the free space on your SSD. The HyperFast feature, included with Diskeeper 12 specifically solves these issues by intelligently eliminating performance–degrading free space fragmentation which can promote random rather than the more efficient sequential writes to occur. This technology along with the IntelliWrite Technology promotes the more efficient and beneficial sequential writes to occur rather than random writes.

More info about their product is available:

http://www.condusiv.com/products/diskeeper/