Rockbox Technical Forums

Support and General Use => Hardware => Topic started by: huedrant on April 12, 2019, 04:41:31 AM

Title: SD lifetime / Flash wear level: can ROCKBOX minimize write cycles?
Post by: huedrant on April 12, 2019, 04:41:31 AM
Hi everyone!
I plan to revive my IPod 5.5 with a 400gb SanDisk SD card via a CF adapter.
As I want to use this as my music and audio book backup device I'm concerned about the wear levels of the SD.

How is Rockbox optimized to minimize write cycles? And is there a setting that I can use to prevent Rockbox from writing often?
What are your results so far when using Rockbox on a SD card? Or is there any other thread floating around regarding this topic?

Thanks for your advice!
Title: Re: SD lifetime / Flash wear level: can ROCKBOX minimize write cycles?
Post by: saratoga on April 12, 2019, 10:27:56 AM
Rockbox is designed to run on devices with storage that takes several seconds to spin up and so very rarely writes anything at all to disk. 
Title: Re: SD lifetime / Flash wear level: can ROCKBOX minimize write cycles?
Post by: SamoDadela on April 30, 2020, 05:45:47 PM
Actually, if you use the Maintain List of Recent Bookmarks feature it will write each time the bookmarks are updated. This is each time a song changes or at least at shutdown. So what happens in this case? Will it write to the same sector or not?

I started getting write errors on my external SD card (Sansa Clip+ boot from external volume) - I never wrote anything to that SD card since I installed RB on it. I'm using Recent Bookmarks, though.


Title: Re: SD lifetime / Flash wear level: can ROCKBOX minimize write cycles?
Post by: saratoga on April 30, 2020, 09:37:52 PM
Flash devices are treated similarly to hard drives.  Writes are saved up and then done concurrently with reads, so if you're just playing tracks from a playlist they'll be buffered until the next time the flash chip is powered up.

If you're worried about wearing out the flash, this is not likely.  With a 4KB block size, you would have to update bookmarks 1000 times to generate the same wear as copying a single 4MB file.  You'd go through hundreds of lithium ion battery replacements before you'd generate the same amount of IO as just copying a reasonable sized music library.
Title: Re: SD lifetime / Flash wear level: can ROCKBOX minimize write cycles?
Post by: SamoDadela on May 01, 2020, 05:59:43 AM
@saratoga: Thanks for the info.

I also found this link https://electronics.stackexchange.com/questions/27619/is-it-true-that-a-sd-mmc-card-does-wear-levelling-with-its-own-controller where it says that wear leveling is not mandated by the SD spec, but that most of the have it built in. Maybe I just got a bad SD card.

I guess you answer also implies that RB relies on the cards wear-leveling implementation and that it does not do its own wear leveling. If SD cards implement they own wear leveling this is quite appropriate.
Title: Re: SD lifetime / Flash wear level: can ROCKBOX minimize write cycles?
Post by: darkcity on June 02, 2020, 06:19:55 PM
Are there any good tools for checking for bad 'sectors' on a MicroSD on Linux?