{"id":32963,"date":"2005-12-15T10:00:11","date_gmt":"2005-12-15T10:00:11","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2005\/12\/15\/you-probably-dont-want-to-run-programs-directly-off-your-usb-memory-drive\/"},"modified":"2005-12-15T10:00:11","modified_gmt":"2005-12-15T10:00:11","slug":"you-probably-dont-want-to-run-programs-directly-off-your-usb-memory-drive","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20051215-11\/?p=32963","title":{"rendered":"You probably don&#8217;t want to run programs directly off your USB memory drive"},"content":{"rendered":"<p>You probably wouldn&#8217;t want to run Windows or applications directly off your USB memory drive, even if you could. The reason is that the solid-state memory used by these drives support only a limited number of write cycles per block. (Originally measured in the thousands, though I&#8217;m led to believe that it&#8217;s gone up since then.) Most software assume that a disk&#8217;s lifetime is essentially infinite and have no qualms about writing to a file multiple times. For example, your program might decide to group its data in chunks. To modify a byte of the file, you would load a chunk, modify the byte, then write the chunk out. You&#8217;ve &#8220;spent&#8221; a write cycle for an entire chunk of data even though you really might have been able to get away with updating a single sector. What&#8217;s more, if that one byte gets modified three times in a row, you just paid for three writes when you could have gotten away with just one if you had just done a little more caching.<\/p>\n<p> Operating systems often update a file&#8217;s metadata with high frequency. The last-modified time on a directory entry gets rewritten each time the file is updated. The free block bitmap is updated each time disk space is allocated or released. The page file gets updated constantly. A database application will update its database index very frequently. Even a simple application will probably update its history and settings files often. These &#8220;hot spots&#8221; are most likely to wear out first on a drive. Unfortunately, these hot spots also tend to coincide with nonrelocatable critical file system metadata; as a result, once the sector responsible for, say, the free cluster table goes bad, the drive is useless (in the absence of hardware sector remapping). <\/p>\n<p> I know some people who wrote a so-called &#8220;Flash File System&#8221; specifically designed for this class of devices. It spread the writes out across the disk so that it wore uniformly, avoiding the &#8220;hot spot&#8221; problem. The file system came out in the early 1990&#8217;s and promptly died because the hardware hadn&#8217;t yet caught up to the software. It was a solution ahead of its time. <\/p>\n<p> Note that my information about the number of write cycles of flash memory is pretty old. Can modern USB drives handle millions of writes before wearing out? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>You probably wouldn&#8217;t want to run Windows or applications directly off your USB memory drive, even if you could. The reason is that the solid-state memory used by these drives support only a limited number of write cycles per block. (Originally measured in the thousands, though I&#8217;m led to believe that it&#8217;s gone up since [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-32963","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>You probably wouldn&#8217;t want to run Windows or applications directly off your USB memory drive, even if you could. The reason is that the solid-state memory used by these drives support only a limited number of write cycles per block. (Originally measured in the thousands, though I&#8217;m led to believe that it&#8217;s gone up since [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/32963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=32963"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/32963\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=32963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=32963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=32963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}