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?

7
  • 3
    I still haven't gotten round to checking the actual installed size, but have you considered starting with Jessie Lite, rather than the full version? It should come in at something like 1.3GB installed (I think), which is at least closer to your 1GB target. You may have to do some extra work installing missing packages.
    – goobering
    Commented Jun 20, 2016 at 14:03
  • 2
    You refer to Debian, which Raspbian more-or-less is, but you can run actual stock Debian on some models of Pi and you've tagged this Raspbian -- also from context it seems pretty clear that's what you mean. Anyway, the "jessie-lite" image is I think < 2 GB unpacked. Note that by filling all the space on an SD card you will be reducing its lifespan due to wear leveling, depending on how much writing is involved. If a cheap is card packed full and used 24/7, you could be looking at months. This may not be as "economical" a choice as you think.
    – goldilocks
    Commented Jun 20, 2016 at 14:06
  • In response to your edit, not everyone wants to run a webserver. Some people want to do other things. Hence: 1.3GB. Lite is still just Raspbian with bits left off. You can take even more bits off if it's still too big and you can find anything spare.
    – goobering
    Commented Jun 20, 2016 at 14:11
  • Hmmm. Minibian claims a 477MB installed size. You may need so many packages it'll erode the savings, but interesting.
    – goobering
    Commented Jun 20, 2016 at 14:19
  • I believe from some of the things said here by Minibian users that it is 1) Not kept up-to-date, 2) Does not have a complete repo creating a PITA if you need stuff that isn't in it. But you can search here for that info yourself, and by all means, give it a spin.
    – goldilocks
    Commented Jun 20, 2016 at 14:31

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.