I was recently looking at storage expansion options on my Raspberry Pi (UK). This choice is limited — USB ports are often used by keyboards, mice, or retro game controllers. while the SD card slot is naturally limited to just one device.
In terms of expanding storage via USB devices, there are two options, but how you connect them will affect your success. For example, you can plug a USB hard drive or flash drive into one of the USB ports, but if another device needs that port, things can get tricky.
Many Raspberry Pi owners use powered USB hubs to get around this problem, and once you realize the importance of this (the computer doesn’t draw enough power to handle most USB devices), add a new USB storage device. otherwise, it shouldn’t be a problem.
However, there are a few things to consider when expanding storage on your Raspberry Pi. While there are really only two common USB drives (flash drive and hard drive), you should also look out for a very useful map extension trick for Raspbian. operating system.
Three main storage options
You will find that you have three main options for adding, storing, and deleting data on your Raspberry Pi:
- SD/SDHC card
- flash drive
- USB hard drive
You can also use network drives, USB DVD-R drives, and NAS devices. NAS devices (probably based on a Raspberry Pi!) For additional storage, but the ones listed above should be considered the top three options.
We will look at the three options in more detail, how they can be used most effectively, and any downsides or disadvantages.
Using an SD card to store Raspberry Pi data
As you probably know if you’re using a Raspberry Pi, the SD card is the main storage option. The Pi uses this card — which should be an SDHC card for best results — as a boot device, to run the operating system, and share storage. It effectively replaces the role of a hard drive in standard desktop computers, although it can be considered more similar to an SSD. in terms of no moving parts and low energy.
There are various operating systems for Raspberry Pi. Probably the most popular is Raspbian. which is designed to run on a 2 GB SD card by default. The result of this is that when flashing a Raspbian image, all SD cards will have a 2 GB partition, leaving a large chunk of SD card memory unused.
Fortunately, there is a way around this. Function file system extensions included in Raspbian’s raspi-config screen and allows you to increase the size of a partition up to the maximum capacity of your SD card. See 4 Tweaks to Supercharge your Raspberry Pi on how to do this.
Connecting and Installing a USB Drive
Inserting a USB flash drive will not have the same effect as in an OS like Ubuntu or Windows. Instead, you will need to manually mount the device in order to use it as an additional USB drive for your Raspberry Pi.
sudo ls /dev/sd*