Tell A Friend

Tell a Friend

Using the Raspberry Pi as a Server for the Home Network – Part 2

One of the neat features of the Raspberry Pi is that the whole operating system and applications run out of a Micro SD card. This allows to quickly switch from one setup to another by simply swap the card.

However, this feature is also its greatest weakness when the RPi is used as an always on server, because a Micro SD card can be written at the same location only a limited amount of times.

SD cards employ an internal algorithm (wear levelling) to use different memory blocks at different times at every write, even if the memory address is the same. This helps in distributing the writing operations across the whole memory chip, and the greater is the capacity of the memory, the longer is the lifetime of the chip. (If you are interested in more details, here is a technical white paper from Sandisk, and here is a high level description of the most used algorithms).

In the case of the Raspberry Pi, the whole Micro SD card is used to store the Linux distribution with all its components. It is also used to store data, like you usually do with any computer. So, as long as you experiment with the RPi and use the system every now and then, the Micro SD card lifetime is not a big issue. However, if you use the RPi as an always on server, the memory storage gets used much more often, and its life expectancy decreases greatly. I read of several people reporting their RPi was behaving erratically, or even stop working at all, after a few weeks that they were using it constantly.

Since in my case I had to build a server for the home network, and I wanted it to be reliable and durable, I obviously had to solve that problem.

My server, in fact, is supposed to stay up all the time, to satisfy any need 24/7.

The way I approached the solution for the problem was to use an external USB drive in combination with the Micro SD card. I left the partitions containing data that rarely change on the memory card, along with the boot partition, and moved all the partitions holding data that I expected to change frequently on an external USB hard disk.

Next time, I will show you the procedure to install the Raspbian distribution on a RPi 2B using a mix of the Micro SD card and a hard disk connected through one of the available 4 USB ports. I will describe more extensively only those steps of the procedure that differ from a regular Raspbian installation done through the NOOB image. If you need more details on the basic parts of the installation, please refer to the Raspberry Pi web site, which provides plenty of information.

Comments are closed.