I noticed this in general: its faster to copy a large file from my computer to my USB than it is to overwrite it. For example, I have a file a.txt thats 10 gb. If my USB is blank and I copy my file to the USB, its pretty quick. However, if my USB already had an outdated version of a.txt and I want to put the new version on it by copying the new one from my computer and pasting it onto my USB, it overwrites the a.txt file. Why does that take longer to overwrite than if my USB was blank? Does it have to do with the number of calls to read/write?
Asked
Active
Viewed 2,151 times
2
-
1You're talking about a USB flash drive, correct? – David Schwartz Mar 18 '14 at 08:57
1 Answers
1
Erasing is much slower than writing. Erasing followed by writing, slower still.
David Schwartz
- 61,528
- 7
- 100
- 149
-
Can't see in what situation erasing is slower. Even zeroing shouldn't take longer that just writing the same data. Do you have any sources to support that? – EliadTech Mar 18 '14 at 08:28
-
Umm, why do you think [TRIM](http://en.wikipedia.org/wiki/TRIM) exists?! It's precisely because erasing is slower than writing. Or see [this](http://en.wikipedia.org/wiki/Flash_memory) which says, "Because erase cycles are slow, ...". Zeroing is as fast as writing, but once a block is zeroed, it has to be erased to contain anything else. – David Schwartz Mar 18 '14 at 08:56
-
2Correct me if I'm wrong but SSD and HDD are far different in operations. SSDs need TRIM because they can't determine which data is free(transistors still holds charge unless manually uncharged). In a delete on an HDD, it is simply deleting a pointer to data allowing that region on the disk to be overwritten which is very quick. This is why Undelete works. On an SSD, it does take longer to free up existing data since it has to actually reset it.See http://www.tuaw.com/2011/03/27/keeping-ssds-in-trim-doing-the-math/ – Jeff F. Mar 19 '14 at 17:33
-
1@JeffF. You are correct. That's another way of saying the same thing I'm saying. – David Schwartz Mar 20 '14 at 18:10
-
@David Finally got to the articles you linked to. Though not fully understood (electronics isn't my strong side), I got the general idea. – EliadTech Apr 15 '14 at 21:46
-
This is not a reasonable answer. The FTL is not going to retain the existing LBA mapping and erase the same physical block so that is can be rewritten. Wear-leveling dictates that a different (potentially already erased) physical block be assigned to the LBA for the rewrite operation. – sawdust Apr 30 '20 at 21:44
-
@sawdust Did you miss that this question was about 10GB files on USB flash drives from 2014, not modern SSDs? – David Schwartz Apr 30 '20 at 21:51
-
@DavidSchwartz -- No, I did not overlook those points. Here's [an article from 2013](https://www.getusb.info/longevity-of-usb-flash-and-wear-leveling/) that points out that USB flash drives can have wear-leveling capability. – sawdust Apr 30 '20 at 22:22
-
@sawdust Again, did you miss that this question was about 10GB files on USB flash drives from 2014? You think his USB drive had 10GB reserved for wear leveling? If so, please tell me what you think explains his observation. – David Schwartz May 01 '20 at 15:22