SSD wear for overwriting the same bytes












1















If writing to an ssd wears out its cells but reading does not, does an ssd read cells to avoid unnecessary writes?



For example, suppose I already zero'd an SSD, would the SSD write anything at all if I were to try and re-zero it?



I think this may be covered by the general technique of SSD "data buffering & caching", but I've not read explicit details...



Is this dependent on the exact scenario, for example:

- The amount being written vs. the size of the SSD cache?

- The speed of the write being pushed vs. the speed SSD's reads (to check) and writes (as necessary)?

- The SSD controller?

- The SSD brand?










share|improve this question























  • The only way you'll know from any specific hardware is to read the SMART information after writing to determine if it recorded it as writes. That said, using this data I've been able to determine that my own SSDs are going to far outlive any conventional drives I've ever had.

    – shawn
    Feb 7 at 8:16











  • The actual likelihood that the sector data is 100% identical in practice is typically very low, so the overhead of performing such a read and compare is pure wasted time. Adding (unnecessary) overhead to a write operation is detrimental to performance. A manufacturer would probably choose to maintain performance (i.e. not add dubious overhead to every write operation) than possibly extend device life by occasionally not perform an erase/write cycle.

    – sawdust
    Feb 7 at 10:04











  • Somewhat related to your example: How to fill a device with zeros, without overwriting the bytes that are already zeros?

    – Kamil Maciorowski
    Feb 7 at 10:36
















1















If writing to an ssd wears out its cells but reading does not, does an ssd read cells to avoid unnecessary writes?



For example, suppose I already zero'd an SSD, would the SSD write anything at all if I were to try and re-zero it?



I think this may be covered by the general technique of SSD "data buffering & caching", but I've not read explicit details...



Is this dependent on the exact scenario, for example:

- The amount being written vs. the size of the SSD cache?

- The speed of the write being pushed vs. the speed SSD's reads (to check) and writes (as necessary)?

- The SSD controller?

- The SSD brand?










share|improve this question























  • The only way you'll know from any specific hardware is to read the SMART information after writing to determine if it recorded it as writes. That said, using this data I've been able to determine that my own SSDs are going to far outlive any conventional drives I've ever had.

    – shawn
    Feb 7 at 8:16











  • The actual likelihood that the sector data is 100% identical in practice is typically very low, so the overhead of performing such a read and compare is pure wasted time. Adding (unnecessary) overhead to a write operation is detrimental to performance. A manufacturer would probably choose to maintain performance (i.e. not add dubious overhead to every write operation) than possibly extend device life by occasionally not perform an erase/write cycle.

    – sawdust
    Feb 7 at 10:04











  • Somewhat related to your example: How to fill a device with zeros, without overwriting the bytes that are already zeros?

    – Kamil Maciorowski
    Feb 7 at 10:36














1












1








1








If writing to an ssd wears out its cells but reading does not, does an ssd read cells to avoid unnecessary writes?



For example, suppose I already zero'd an SSD, would the SSD write anything at all if I were to try and re-zero it?



I think this may be covered by the general technique of SSD "data buffering & caching", but I've not read explicit details...



Is this dependent on the exact scenario, for example:

- The amount being written vs. the size of the SSD cache?

- The speed of the write being pushed vs. the speed SSD's reads (to check) and writes (as necessary)?

- The SSD controller?

- The SSD brand?










share|improve this question














If writing to an ssd wears out its cells but reading does not, does an ssd read cells to avoid unnecessary writes?



For example, suppose I already zero'd an SSD, would the SSD write anything at all if I were to try and re-zero it?



I think this may be covered by the general technique of SSD "data buffering & caching", but I've not read explicit details...



Is this dependent on the exact scenario, for example:

- The amount being written vs. the size of the SSD cache?

- The speed of the write being pushed vs. the speed SSD's reads (to check) and writes (as necessary)?

- The SSD controller?

- The SSD brand?







ssd physical-wear






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 7 at 2:49









dumb0dumb0

83




83













  • The only way you'll know from any specific hardware is to read the SMART information after writing to determine if it recorded it as writes. That said, using this data I've been able to determine that my own SSDs are going to far outlive any conventional drives I've ever had.

    – shawn
    Feb 7 at 8:16











  • The actual likelihood that the sector data is 100% identical in practice is typically very low, so the overhead of performing such a read and compare is pure wasted time. Adding (unnecessary) overhead to a write operation is detrimental to performance. A manufacturer would probably choose to maintain performance (i.e. not add dubious overhead to every write operation) than possibly extend device life by occasionally not perform an erase/write cycle.

    – sawdust
    Feb 7 at 10:04











  • Somewhat related to your example: How to fill a device with zeros, without overwriting the bytes that are already zeros?

    – Kamil Maciorowski
    Feb 7 at 10:36



















  • The only way you'll know from any specific hardware is to read the SMART information after writing to determine if it recorded it as writes. That said, using this data I've been able to determine that my own SSDs are going to far outlive any conventional drives I've ever had.

    – shawn
    Feb 7 at 8:16











  • The actual likelihood that the sector data is 100% identical in practice is typically very low, so the overhead of performing such a read and compare is pure wasted time. Adding (unnecessary) overhead to a write operation is detrimental to performance. A manufacturer would probably choose to maintain performance (i.e. not add dubious overhead to every write operation) than possibly extend device life by occasionally not perform an erase/write cycle.

    – sawdust
    Feb 7 at 10:04











  • Somewhat related to your example: How to fill a device with zeros, without overwriting the bytes that are already zeros?

    – Kamil Maciorowski
    Feb 7 at 10:36

















The only way you'll know from any specific hardware is to read the SMART information after writing to determine if it recorded it as writes. That said, using this data I've been able to determine that my own SSDs are going to far outlive any conventional drives I've ever had.

– shawn
Feb 7 at 8:16





The only way you'll know from any specific hardware is to read the SMART information after writing to determine if it recorded it as writes. That said, using this data I've been able to determine that my own SSDs are going to far outlive any conventional drives I've ever had.

– shawn
Feb 7 at 8:16













The actual likelihood that the sector data is 100% identical in practice is typically very low, so the overhead of performing such a read and compare is pure wasted time. Adding (unnecessary) overhead to a write operation is detrimental to performance. A manufacturer would probably choose to maintain performance (i.e. not add dubious overhead to every write operation) than possibly extend device life by occasionally not perform an erase/write cycle.

– sawdust
Feb 7 at 10:04





The actual likelihood that the sector data is 100% identical in practice is typically very low, so the overhead of performing such a read and compare is pure wasted time. Adding (unnecessary) overhead to a write operation is detrimental to performance. A manufacturer would probably choose to maintain performance (i.e. not add dubious overhead to every write operation) than possibly extend device life by occasionally not perform an erase/write cycle.

– sawdust
Feb 7 at 10:04













Somewhat related to your example: How to fill a device with zeros, without overwriting the bytes that are already zeros?

– Kamil Maciorowski
Feb 7 at 10:36





Somewhat related to your example: How to fill a device with zeros, without overwriting the bytes that are already zeros?

– Kamil Maciorowski
Feb 7 at 10:36










1 Answer
1






active

oldest

votes


















2














It might, or it might not. Without knowing the exact model and it's exact firmware I don't think you can tell (and even then, unless you wrote the firmware it's still hard to be sure).



It's safe to assume that an SSD (or basically any flash media) might not overwrite what you want it to, it could:




  • write any sector anywhere

  • move old sectors to normally inaccessible "reserve" areas

  • some use compression, so writing GB's of zeros could take up virtually no space & actually write almost nothing

  • some always use encryption (whether or not you enter a password), and issuing a special "wipe drive" command only forgets the old encryption key & sets a new one, writing virtually nothing. (I've read some could implement this very poorly too)


The only constant should be that if you just wrote zeros somewhere, then you should read back zeros from there. But what actually happens behind the scenes is almost a literal "black box".






share|improve this answer


























  • "I've read some ignore zero writes and do a discard/TRIM instead" -- I'd be interested in reading about that. Please provide some links. Re: superuser.com/questions/1242000/…

    – sawdust
    Feb 7 at 10:32











  • @sawdust I thought I remember reading something similar, but didn't find any concrete hits, so may have misremembered that detail, I'll remove it (it's kind of overlapping the compression case anyway, and the main idea is still "an ssd could do almost anything" ;-)

    – Xen2050
    Feb 7 at 11:02











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1402941%2fssd-wear-for-overwriting-the-same-bytes%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














It might, or it might not. Without knowing the exact model and it's exact firmware I don't think you can tell (and even then, unless you wrote the firmware it's still hard to be sure).



It's safe to assume that an SSD (or basically any flash media) might not overwrite what you want it to, it could:




  • write any sector anywhere

  • move old sectors to normally inaccessible "reserve" areas

  • some use compression, so writing GB's of zeros could take up virtually no space & actually write almost nothing

  • some always use encryption (whether or not you enter a password), and issuing a special "wipe drive" command only forgets the old encryption key & sets a new one, writing virtually nothing. (I've read some could implement this very poorly too)


The only constant should be that if you just wrote zeros somewhere, then you should read back zeros from there. But what actually happens behind the scenes is almost a literal "black box".






share|improve this answer


























  • "I've read some ignore zero writes and do a discard/TRIM instead" -- I'd be interested in reading about that. Please provide some links. Re: superuser.com/questions/1242000/…

    – sawdust
    Feb 7 at 10:32











  • @sawdust I thought I remember reading something similar, but didn't find any concrete hits, so may have misremembered that detail, I'll remove it (it's kind of overlapping the compression case anyway, and the main idea is still "an ssd could do almost anything" ;-)

    – Xen2050
    Feb 7 at 11:02
















2














It might, or it might not. Without knowing the exact model and it's exact firmware I don't think you can tell (and even then, unless you wrote the firmware it's still hard to be sure).



It's safe to assume that an SSD (or basically any flash media) might not overwrite what you want it to, it could:




  • write any sector anywhere

  • move old sectors to normally inaccessible "reserve" areas

  • some use compression, so writing GB's of zeros could take up virtually no space & actually write almost nothing

  • some always use encryption (whether or not you enter a password), and issuing a special "wipe drive" command only forgets the old encryption key & sets a new one, writing virtually nothing. (I've read some could implement this very poorly too)


The only constant should be that if you just wrote zeros somewhere, then you should read back zeros from there. But what actually happens behind the scenes is almost a literal "black box".






share|improve this answer


























  • "I've read some ignore zero writes and do a discard/TRIM instead" -- I'd be interested in reading about that. Please provide some links. Re: superuser.com/questions/1242000/…

    – sawdust
    Feb 7 at 10:32











  • @sawdust I thought I remember reading something similar, but didn't find any concrete hits, so may have misremembered that detail, I'll remove it (it's kind of overlapping the compression case anyway, and the main idea is still "an ssd could do almost anything" ;-)

    – Xen2050
    Feb 7 at 11:02














2












2








2







It might, or it might not. Without knowing the exact model and it's exact firmware I don't think you can tell (and even then, unless you wrote the firmware it's still hard to be sure).



It's safe to assume that an SSD (or basically any flash media) might not overwrite what you want it to, it could:




  • write any sector anywhere

  • move old sectors to normally inaccessible "reserve" areas

  • some use compression, so writing GB's of zeros could take up virtually no space & actually write almost nothing

  • some always use encryption (whether or not you enter a password), and issuing a special "wipe drive" command only forgets the old encryption key & sets a new one, writing virtually nothing. (I've read some could implement this very poorly too)


The only constant should be that if you just wrote zeros somewhere, then you should read back zeros from there. But what actually happens behind the scenes is almost a literal "black box".






share|improve this answer















It might, or it might not. Without knowing the exact model and it's exact firmware I don't think you can tell (and even then, unless you wrote the firmware it's still hard to be sure).



It's safe to assume that an SSD (or basically any flash media) might not overwrite what you want it to, it could:




  • write any sector anywhere

  • move old sectors to normally inaccessible "reserve" areas

  • some use compression, so writing GB's of zeros could take up virtually no space & actually write almost nothing

  • some always use encryption (whether or not you enter a password), and issuing a special "wipe drive" command only forgets the old encryption key & sets a new one, writing virtually nothing. (I've read some could implement this very poorly too)


The only constant should be that if you just wrote zeros somewhere, then you should read back zeros from there. But what actually happens behind the scenes is almost a literal "black box".







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 7 at 11:03

























answered Feb 7 at 3:57









Xen2050Xen2050

11.1k31636




11.1k31636













  • "I've read some ignore zero writes and do a discard/TRIM instead" -- I'd be interested in reading about that. Please provide some links. Re: superuser.com/questions/1242000/…

    – sawdust
    Feb 7 at 10:32











  • @sawdust I thought I remember reading something similar, but didn't find any concrete hits, so may have misremembered that detail, I'll remove it (it's kind of overlapping the compression case anyway, and the main idea is still "an ssd could do almost anything" ;-)

    – Xen2050
    Feb 7 at 11:02



















  • "I've read some ignore zero writes and do a discard/TRIM instead" -- I'd be interested in reading about that. Please provide some links. Re: superuser.com/questions/1242000/…

    – sawdust
    Feb 7 at 10:32











  • @sawdust I thought I remember reading something similar, but didn't find any concrete hits, so may have misremembered that detail, I'll remove it (it's kind of overlapping the compression case anyway, and the main idea is still "an ssd could do almost anything" ;-)

    – Xen2050
    Feb 7 at 11:02

















"I've read some ignore zero writes and do a discard/TRIM instead" -- I'd be interested in reading about that. Please provide some links. Re: superuser.com/questions/1242000/…

– sawdust
Feb 7 at 10:32





"I've read some ignore zero writes and do a discard/TRIM instead" -- I'd be interested in reading about that. Please provide some links. Re: superuser.com/questions/1242000/…

– sawdust
Feb 7 at 10:32













@sawdust I thought I remember reading something similar, but didn't find any concrete hits, so may have misremembered that detail, I'll remove it (it's kind of overlapping the compression case anyway, and the main idea is still "an ssd could do almost anything" ;-)

– Xen2050
Feb 7 at 11:02





@sawdust I thought I remember reading something similar, but didn't find any concrete hits, so may have misremembered that detail, I'll remove it (it's kind of overlapping the compression case anyway, and the main idea is still "an ssd could do almost anything" ;-)

– Xen2050
Feb 7 at 11:02


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1402941%2fssd-wear-for-overwriting-the-same-bytes%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?