2

I am using a Raspberry Pi in an industrial area as a data-logger and had to deal with SD-Card wear so that I decided to use SLC-SD-Cards with higher quality.

To keep costs for those card types low, I am currently trying to figure out how to shrink down the Raspbian Image to a very small size so that it will fit onto a 1GB (or 2GB in the bad case) SD-Card!

I have purged a lot of packages - including X11 - but still have a disk usage of remaining 1,8GB. Less would be better!

What I need for running my application is:

  • Python 2.7.x
  • lighttpd-Web-Server
  • PHP
  • RRD-Tool
  • SPI-Library
  • Bonjour/Zeroconf

I was also thinking of using a different system - other than Debian, like buildroot but I have absolutely no clue if this is necessary and what to do to install buildroot linux.

Additionally I could ask this the other way round: When using the official 'Lite' version of the Raspbian System it comes with a size of approx. 1.3GB which is - like mentioned in the comments below - a bit closer to my 1GB. But where do that 1.3 GB come from when all I want to do is put up a very small websever + python script and a database of less than 5MB !? Or. How to remove those things I don't need?

Simon Kemper
  • 193
  • 1
  • 2
  • 7

1 Answers1

1

I just ran du -h on the root partition of a recent (March 2016) jessie-lite image -- as in, one that is totally unmodified and unused. The total volume of data is 714 MB.

That would not include most of the items on your list (I am sure it includes python 2.7.x as this is a fundamental requirement, and avahi, a zeroconf implementation, is stock), but in any case, to be sane (as opposed to "short-sightedly clever"), and because of what I mentioned in a comment about wear leveling, I strongly advise against using anything smaller than a 2 GB card. I think your clients will prefer something that cost a couple of extra bucks vs. something that is going to fail later this year.

I do not think the remainder of your list would take much space, BTW, perhaps a few hundred MB at most (PHP and RRD-tool are wildcards for me, dependency wise).

Note that the actual size of the partition is larger than than 714 MB; the uncompressed image is ~1.3 GB, which includes a 60 MB boot partition that is half full, but you could shrink it down to fit on a 1 GB card, or, again, to be sane, expand it to fill a 2 GB card.

How to remove those things I don't need?

There is not much there to remove that you don't need, which is the whole point of the lite image. To emphasize my point about sanity: Depending on a remote, long running unit with a writable root partition that is 90%+ full is complete foolishness and you will get what you deserve if you follow that path.

goldilocks
  • 60,325
  • 17
  • 117
  • 234