Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
What’s the life expectancy of an SD card?

I recently got my raspberry PI and I was thinking about using it as a torrent box.

For that, would you advise to connect an external USB disk? Or having a very big SDcard (32+ GB) would be enough?

If i'm not mistaken I read somewhere that using only the SD would put too much stress onto it, and as it's not made for these kinds of usage, it would wear somewhat fast.

In general, in which other examples would you say that it's best to not use the SD card?

Thanks in advance!

share|improve this question
    
This is not asking about the life-expectancy of an SD card, it is asking about usage recommendations for SD cards due to life-expectancy. –  Synetech Dec 25 '12 at 17:38
add comment

marked as duplicate by Tom Wijsman, Karan, DragonLord, Simon Sheehan, techie007 Dec 25 '12 at 19:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 3 down vote accepted

If i'm not mistaken I read somewhere that using only the SD would put too much stress onto it, and as it's not made for these kinds of usage, it would wear somewhat fast.

SD cards use flash-memory which means that they have a limited number of write-cycles. As such, writing to them too many times will “wear them out”. That said, the number of cycles is usually in the 100,000 range for most cards. In addition, they often have some spare cells to dynamically remap dead cells (i.e., wear-leveling). (SSDs which also use flash-memory often employ the TRIM command to reduce the amount of data being written, but SD cards rarely, if ever use that.) These tricks extend the life of an SD card (or flash-drive) by enough to make them good enough to replace not only floppy drives for general usage, but even CD-RW/DVD+RW which have write limits of 1,000-10,000 (not to mention all the problems with packet-writing in general).

I recently got my raspberry PI and I was thinking about using it as a torrent box.

For that, would you advise to connect an external USB disk? Or having a very big SDcard (32+ GB) would be enough?

If by “torrent box” you mean a seedbox, then no, there is absolutely no reason that a memory cards (or flash-drives or SSDs) would be a problem because you would be writing the file to it just once, then reading it numerous times, and there are no damaging effects of reading from flash-memory.

If by “torrent box” you mean using it as a system for downloading torrents, then the answer it that it depends.

As I said in the first part, flash-memory doesn’t like writes. The question then becomes whether downloading a file via torrents causes more writes than simply copying the file from a hard-drive. I have wondered this myself and have yet to find a definitive answer because nobody seems to have done any actual experiments (though it should not be too hard to design one).

That said, a little bit of logic and common sense indicates that it does indeed cause more disk writes because copying a file copies the whole thing a single time in a single stream. As such, each sector of the file is already available and ready to be written. On the other hand, with a torrent, each piece of the file is slowly downloaded, which means that the torrent client has to write each piece of each piece to disk which of course means many more writes.

Obviously this behavior varies from client to client, but most have disk caches which you can configure so that it waits until it has received a specific amount before flushing the data to disk. Of course even with this, it will still create at least some extra writes because the pieces of a torrent’s files are rarely sector-aligned ((offset(file) mod sizeof(piece) = 0) && (sizeof(piece) mod sizeof(sector) = 0)), so you could easily end up having one extra write for each piece of each file.

In general, in which other examples would you say that it's best to not use the SD card?

You can safely use flash memory like SD cards, flash-drives, and SSDs as any sort of backup because writes are infrequent. However using them as storage for anything that has a lot of writes like temporary directories, swap files, etc. is usually going to be a bad idea.

Uses in the middle like an OS drive or a data drive where you store the files you are working on will be a grey area that depends on your own specific usage patterns. (A note about using flash-memory for the OS system drive: some OSes like Windows tend to write a lot of stuff to the system drive all the time. Some of these, like system logs, swap files, user documents, etc. can be configured to be stored on at a different location, but there are still some that cannot be, and so even an idling system will cause writes to the system drive.)


Don’t forget however that the card is not permanently built-in to the Rπ, so even if it does (eventually?) wear out, you can just replace it.

share|improve this answer
    
Wow! Really thorough answer. Thank you very much, you really helped clearing my mind about these things! –  Helios Dec 25 '12 at 18:15
    
No problem. I have been thinking about getting an Rπ to use as a web- and blog-server and been thinking about the impact of an SD card for a while. In my case, it would be okay so long as there is not too much activity from comments, etc. causing database writes. ☺ –  Synetech Dec 25 '12 at 18:35
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.