The Raspberry Pi computer is fast overtaking all other devices and is now second only to Android based smartphones. Most Raspberry Pi devices run the Raspberry Pi OS on microSD cards. How much space do you need for the operating system and other parts of your project?
This page is updated for the 64 bit version of the Raspberry Pi OS with Desktop released on May 3, 2023 and based on the Debian Bullseye distribution of Linux.
Who uses the Raspberry Pi OS?
There are about a billion Raspberry Pi devices out in the world and most use the Raspberry Pi OS for education, small to medium projects, and general office use in small businesses. Home media projects might use an alternative like LibreELEC with KODI. In most cases people use the Pi OS first then they may experiment with something else for a specific use. As an example, they may use a Raspberry Pi 3B as an experiment to build a router then switch to something like OpenWrt on a smaller Pi, perhaps a Pi Zero.
What is Raspberry Pi OS?
Raspberry Pi OS is a distribution of Linux, which means it has a core of Linux then other things added on. You might compare a Linux distribution to a Lotus car. Lotus do not make engines so they buy engines from Renault, Ford, Mercedes, whoever. A Linux distribution is an operating system with a Linux engine.
Raspberry Pi have three versions of their OS, the standard 32 bit version for all Raspberry Pi devices, a new 64 bit version for later models, and a Raspberry Pi Desktop OS for AMD/Intel based computers. I am looking at the most common version, the 32 bit version, as I have several models of the Raspberry Pi.
The various models of the Pi have ARM processors, the same as your smartphone, tablet, television, and are ARMv6, ARMv7, or ARMv8. All the standard Pi software is compiled for ARMv6 and runs across all devices. Some add-on software is compiled for ARMv7 which means it will not run on my Pi Zero.
The user interface, the GUI, is LXDE which is lighter in weight than most of the other GUIs available for Linux. LXDE works on my smallest Pi, the Zero.
Here is the disk space usage of the Raspberry Pi OS at the first login before updates or adding other applications. This list is from the command df -h. Other commands and applications will give different results according to what they include and how they calculate the total.
Filesystem |
Size |
Used |
Avail |
Use% |
Mounted on |
/dev/root |
15G |
3.3G |
11G |
24% |
/ |
/dev/mmcblk0p1 |
255M |
31M |
225M |
13% |
/boot |
Here is the disk space usage of the Raspberry Pi OS and all the applications I add but before those applications are first used. Many of the applications will use a megabyte to store settings then an unknown amount when they generate data.
Filesystem |
Size |
Used |
Avail |
Use% |
Mounted on |
/dev/root |
15G |
3.9G |
9.9G |
29% |
/ |
/dev/mmcblk0p1 |
255M |
31M |
225M |
13% |
/boot |
When would you worry about disk space?
The Raspberry Pi uses a microSD card as the system disk. When I purchased my first Pi, the Pi people recommended an 8 GB card. I found the card filled up too fast for general projects. For my next Pi, I used a 16 GB card and did not have to worry about space. Now 32 GB cards is the minimum size for high quality microSD cards with the minimum speed to make full use of a Raspberry Pi 4, a minimum of A1 and V30.
You can download the Pi OS as the regular version called Desktop or a bigger version described as "desktop and recommended software" or a small version with no GUI, no Graphical User Interface, called Lite. The full version needs 8 GB before starting anything, about 3 or 4 GB for software and another few GB for temporary files. Start with a 32 GB card for the regular and full versions. Use old 16 GB cards for the lite version if there is only some logging, not the generation of data files.
After you develop a project, you can delete anything you are not using then look at the space used. You might be able to recycle an old small card for a less demanding project. If you start with the lite version of the OS and your project logs small amounts of data, your project might log for a year before it fills a 16 GB card. Given the small price difference between good quality 16 GB cards and the same brand and model in 32 GB, I cannot be bothered worrying about what might happen when using a 16 GB card.
For anything bigger, you are better off adding a USB disk for the data or shipping logged data to a central file server. There are lots of old 128 GB SSDs left over from upgrades, an obvious starting point for an SSD.
Did you add a camera? Pi projects often feature a camera and there are add-on cameras with higher resolution. One good image can be over 1 MegaByte. My photographs, when edited down to 2K television size, are in the range of 1.2 MB up to 1.6 MB. Set up a monitoring system to take one photograph per hour. You are using from 29 MB up to 38 MB per day. That is 1.2 GB per month. Now multiply by the minimum of six cameras I would need to monitor my garden for growth, glowering, fruit, and pests. Over 7 GB per month. I need up to two months for travel. That pushes the minimum size up past 32 GB.
Now add faster monitoring when there is movement, perhaps one image per minute for the hour that a possum might eat flowers in the garden. an extra 6 GB. A possum and a cat? You can see how it quickly adds up over 32 GB. An upgrade to 4K would make the same activity use 128 GB.
Just one camera monitoring seedling growth to produce a slow motion video could produce more than 2 GB per day. There goes another 64 GB. A 128 GB SSD left over from a notebook upgrade might not be big enough. You can find suitable 500 GB SSDs in the bargain bin without dropping down to unknown brands.
Where do you look for disk space usage?
This page is one place. The space mentioned here is the space you need for the first boot into your new system. You can then look at the file manager to see ongoing usage and free space.
You need to check the usage for each application you use. Applications log usage. For most, it is just tiny amounts. Some dump huge amounts or create big backups on a regular basis. Check the space used each day for a week then each week for a month then each month. If the overall increase is slow, there is nothing to worry about.
For a medium speed increase, shop around for a bigger card on sale. For a fast increase, plug in a USB SSD.. The Raspberry Pi 4 can boot direct from a UBS SSD instead of a microSD card, making the SSD relatively cheaper because you do not have to buy the microSD card.
Why would you over allocate space?
Why install far more space than you need? Lets start with program code. The Pi OS full version has lots of educational software that doubles the space used by the OS. When you install a program, it can be huge compared to the trim software supplied with the regular OS. A tiny program can request lots of other packages including hundreds of megabytes of Java. Ouch!
Any program can write logs of activity and data. They are usually small. Across a year and multiplied by dozens of programs, they can fill a small card. Do you want your garden watering system to fail when you go on holidays just because you saved $3 by using a smaller card?
Anything that creates images or videos will flood the biggest card. You need to set the system to delete the oldest files on a regular basis or buy big. The system can still expand due to missed items or a slight increase in the frequency of recording.
Think about an automated security camera recording only movement. You set it up and it runs reliably for a few months. You forget about it. A cat moves into the neighbourhood and sets off your camera recording for hours each night.
When you add a disk, magnetic or SSD, the work and cost involved is significant. The important thing is the work does not increase no matter how big the disk. A 2.5" magnetic disk could be 1 TeraByte or 5 TB, the installation and setup are the same. The cost is often not much different. Our local shops sometimes have 2 TB USB disks on sale for the same price as their 1 TB disks. In the same range, 4 TB disks are often on sale as there is so much competition. SSDs are in the same price fight for anything up to 2 TB.
If you are not in a rush, you can often buy twice the size for just a few dollars more. The extra space might mean you can relax on holidays for several months instead of a few weeks, your plants will be watered perfectly.
Way?
Way to create space? Way to maintain space. You need a plan.
Creating microSD card space is easy, buy bigger. You can buy up to 1 TB. Those big cards are expensive. Watch the items on sale. I am about to buy a 64 GB card because a fast high quality card is on sale at half price and I will have it for my next project.
Adding a USB storage device is more work. You have to buy the storage device and an enclosure or a device in an enclosure. You need a cable if not supplied. You might need a USB hub to expand the range of USB ports. You have to plug the device in then configure the OS to direct data onto the device. You have to test. What happens when the device is unplugged?
One simplification is the Pi 4 option to boot from a USB SSD. Just load the OS image onto the SSD then boot. The Pi 4 will look for the microSD card then look for USB storage. After the boot, you can configure the Pi 4 to boot direct from the USB disk before looking for the microSD card.
Your external storage could be a USB flash memory stick but they are often no faster or more useful or cheaper than a bigger microSD card. In fact the plugged in stick can be bumped, breaking your Raspberry Pi computer. Plugged in sticks should be on an extension lead or in a hub. Recycling an old USB stick also means you get the slower speed of the old sticks plus less reliability.
A USB magnetic disk makes the most sense for anything greater than 1 TB up as the disks are cheap. The Pi 3B, 3B+, and 4 can power a 2.5" disk. The Pi 4 can power 2 of those disks. Local office supply shops always have at least one brand on sale as there is so much competition. For more than 5 TB of storage, you need 3.5" disks with external power.
The biggest disadvantage of magnetic disks is the way they die when bumped. Magnetic disks are good in desktop computers because desktops are no bumped off your desk onto the floor. I would only use a rotating rust device in a Pi project if the project was built into a solid box that will not move.
SSDs use less power and some can run off a USB 2 port. SSDs below 1 TB are always on sale. Plus there are lots of SSDs left over from upgrades to larger SSDs. The left overs may be mSATA and there are really low cost mSATA enclosures. You can also buy bare boards for the mSATA drive or just leave off the enclosure case when your project will be enclosed.
mSATA on a USB board is exactly the same size as a Pi Zero, making it easy to stack the two. NVMe in the 2280 size will fit but the carrier board is often 22110 which means you have to cut off the excess. Some NVMe carrier boards are not designed to be cut so be careful with the chain saw.
Worth?
Last time I purchased a microSD card, the shops had dropped quality fast 16 GB cards and moved 32 GB down to the same price. Today I found quality fast 64 GB cards for the same price as 32 GB. Skimping on the microSD card space is no longer worth the effort for anything less than the new Raspberry Pi 4 model.
The Raspberry Pi models up to the 3B+ all have USB2 connections. The Pi 4 has USB3. With USB3, you can make use of fast SSDs for managing large amounts of data. When anyone upgrades an SSD for more space, the old SSD can plug into a Pi 4 for really fast data access compared to a microSD card. I suggest a Pi 4 with more than 64 GB of data should use an SSD for the data, not the microSD card.
The original mSATA drives on notebook computers were 128 GB. Many of those notebooks are falling apart but have perfectly good SSDs ready to recycle into your next Pi project. Many of those 128 GB SSDs were replaced with 512 GB or larger SSDs. An mSATA to USB 3 enclosure is only a few dollars. The result is cheaper than a fast 128 GB microSD card.
NVMe PCIe 3 SSDs are dropping in price as manufacturers focus on PCIe 4 then PCIe 5. USB 3.1 5 Gbps enclosures are cheap. USB 3.1 10 Gbps and faster are still expensive and are faster than the Pi USB 3 ports, for both the Pi 4 and the planned Pi 5.
Conclusion
Plan ahead. Shop around. Buy far bigger than what you need for your first project. After the project passes all testing and you have more experience, you can downsize to smaller storage then recycle the big storage for the next project.
- Log in to post comments