How to expand the memory of the Raspberry Pi with USB sticks. The Raspberry Pi is a small and fast computer that can quickly replace a PC or media center. But for many users, the biggest problem is the too small memory. I will show you how to increase the memory of the Raspberry Pi with a USB flash drive or external USB hard drive. More memory for the Raspberry Pi.
The bootable SD card and its capacity
The Pi boots its system from an SD card. This is mandatory and cannot be done in any other way. In most cases, Raspberry Pi users have an 8 GB card on which, apart from the system and SWAP partition, there is usually only about 4 or 5 GB free for data. NOOBS users usually have much less… With the command “df -h” you can see how much space is left.
An alternative is a larger SD card, but as these die from time to time due to constant writing of logs (especially with non-name SD cards), it is not worth investing in a card of 100 GB or more. In addition, data is also lost if the card is defective.
USB sticks and Raspberry Pi
USB sticks are a simple and cheap method. The Raspberry Pi has 4 USB slots. Enough space to connect up to 4 additional storage devices.
If you plug a USB stick into your PC, just wait two seconds and you can access the stick. The whole thing also works with the Raspberry Pi if you install some software. You need two pieces of software for this:
- One is called USBmount
- the other one is called NTFS-3G.
If you want to mount an NTFS system in a readable way, you need this. With “sudo apt-get install” you get it. If you insert a USB stick, then you may be able to access it with the command “df -h”. You will see “media/pi” and then the name of the USB stick. Type “cd/media/pi/” and you will see that there is a file “hi.txt” and I can also delete, write and modify it with “touch servus.txt”. You can create a new file.
At the time of registration, it is not expected that such a USB stick is mounted automatically, so you still need to make a small change. And this once in the file “lib/system/system/ systemd-udevd.service”. In the project files you can simply copy and paste.
With “sudo nano” you open an editor with administrator rights and enter the name of this file. You scroll down a bit. Under “MountFlags” you will probably see the entry “MountFlags = save”. Please change this to “MountFlags = shared”. And with Ctrl+O you can save the whole thing and end it with Ctrl+X. And now you have to reboot the Raspberry once and it automatically recognizes the USB sticks as soon as they are plugged in.
If you really need a lot of memory, an external hard drive connected via USB is the only other alternative.
Conclusion
USB sticks are a cheap and easy way to add memory to the Raspberry Pi. USB sticks have the big advantage that they can be easily swapped between several Raspberry Pi, a feature that makes sense especially with the small, versatile computer.
How much memory do you need on the Raspberry Pi? Do you think USB sticks are a good alternative for increasing memory?