SSDs or solid disks as they are known, is not a completely new technology since it has been on the market for several years, however compared to HDDs (hard disks) it is still a baby in diapers. However, the Raspberry Pi It has neither HDD nor SSD, but rather an SD, which has been a memory card ... like a pendrive, according to Wikipedia:
Secure Digital (SD) is a memory card format for portable devices such as digital cameras, mobile phones, laptops, and even game consoles (both desktop and portable), among many others.
If you live in Spain and decide to buy your Raspberry Pi there in Spain, as if you live in another country and opt for eBay, Amazon or any local store, your Raspberry Pi will come with an SD, which has its pros and cons. First of all, in some cases it will work faster than an HDD, but it has a shorter useful life, that is, it will last less, so here are several tips to extend the life of the SD of your Raspberry Pi.
The main problem with SD cards is their limited writing capacity. That is, we can only write a maximum number of times or data in a given sector / space, it is not that we can write, erase, rewrite and so on indefinitely, we cannot do that forever, the time will come when it cannot be keep writing to the SD.
Therefore, here are some tips to extend the life of our SD on the Raspberry Pi:
- A higher capacity SD: It's simple, if we have an 8GB SD we have X space to write information, that space has a limited amount of reading and writing, but if the SD is (for example) 16GB then we will have more space, which translates into no it will be necessary to write so many times in the same area, that is, there is more space inside the SD where to put data.
- Buy from prestigious brands: It is not a secret, as it happens with the SD it happens with other hardware components. For example smartphones, we can buy a Chinese one that will cost us $ 30 and apparently according to the hardware specifications it can do almost the same as a $ 300 Nexus, however, in the long run the rare brand (Chinese) does not work. With the SD it is the same, there are many manufacturers but recognized as a good brand, with quality there are not so many. It is always good to Google for SD manufacturers with good quality, then see if any Raspberry Pi store in Spain or your locality has these SDs in stock. Draw your own conclusions regarding value for money.
- Set Linux to write more to RAM and less to SD: Similar to point 1, the less is written in the SD, the better. We can achieve writing more to RAM and less to SD using tmpfs
To tell the system to write more to RAM and less to the storage device (in this case, SD) just add a line to / etc / fstab. In that line we indicate which folder we want to be mounted in RAM and not in SD, for example:
tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0
By the way, if you need more than 100mb for that partition, modify that value on the line, putting a maximum size we are making sure that it does not consume all the RAM. Then restart the computer and that's it.
Clarification, everything that is mounted with tmpfs (for example, / var / logs) will be lost when the computer is restarted, that is, when they restart they will not have the logs, they will be blank, and so on for each folder they mount.
These tips are optimal well for your Raspberry Pi as well as if they have a PiPad. I do not know for what other equipment would be useful because, I do not know other hardware that does not work with an HDD or SSD and yes with an SD card, come on, unless it is not a camera 🙂
I hope you have found it interesting, especially knowing the tip of how tmpfs works