Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8023

Raspberry Pi OS • How to Optimize Full RPi OS Image for Minimal Size and Memory Usage

$
0
0
Hi everyone,

I’m running a Raspberry Pi 4 Model B (2 GB RAM) with a 16 GB SD card. I flashed the full Raspberry Pi OS image and currently have several components running together — an AFP SDK, a custom UI, a TensorFlow Lite model, OTA update service, and Portkey (SSH) access etc.

I’ve managed to make everything work within 2 GB of RAM, but my storage usage looks like this:

pi@raspberrypi:~ $ df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/mmcblk0p2 ext4 16G 12G 2.6G 83% /
...

I’ve already removed unnecessary snapd, logs, and unused packages, but the system is still quite large.

I’d like to optimize the image further — ideally by keeping only the essential drivers, libraries, and packages required for my setup.

Could someone please guide me on:

1. The best approach to strip down the RPi OS image safely?

2. Whether building a custom minimal image is better than pruning an existing one? If yes, then how to do it?

3. Any specific tools or steps to remove non-essential system components without breaking dependencies?


Thanks in advance for your suggestions!

-Swapnil

Statistics: Posted by SwapnilG — Fri Nov 07, 2025 7:05 am



Viewing all articles
Browse latest Browse all 8023

Trending Articles