Core 3 Diskspace

Topics about the Software of Revolution Pi
IFXE

Core 3 Diskspace

Post by IFXE »

Hi

After installing the latest Stretch image of Raspbian as provided here, is 1.3GB left of Flash memory and 2.7GB used (4GB total). This does not leave much room for updates and software to be installed on the device. Currently I am not using any of the IO or gateway modules (but that might change in the future), so my question is what packages should/could I remove and how to restructure the installation to have a lighter footprint on the disk?

I want to install the Azure IoT Edge packages that require python and docker (Moby) to be installed, and most things else are in the "nice-to-have" category.

Azure IoT Edge works by installing software as docker-modules, that is managed from the Azure IoT Hub in the cloud. These modules would then interface with device and surrounding systems, as required.
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Core 3 Diskspace

Post by dirk »

Hi, you may free disk space by removing all packages that are unnecessary for your application. So it depends on you which packages you may remove. Here is a similar discussion.
But to show a practial example here is what I can provide:

The available space on fresh stretch image:

Code: Select all

df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.5G  2.5G  850M  75% /
Query the packages and sort by size (found here)

Code: Select all

dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n
...
168481  oracle-java8-jdk
Deinstall the biggest package which is here the Java 8 development kit

Code: Select all

sudo apt purge oracle-java8-jdk
The available space has increased by about 250 Mb

Code: Select all

df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.5G  2.3G  1.1G  69% /
I hope that this helps you.
IFXE

Re: Core 3 Diskspace

Post by IFXE »

Thank-you for your reply.

I guess I'm asking because there are several systems installed from Kunbus such as PiCtory, Procon, web admin, gateway modules etc, that may or may not require certain packages (such as JDK etc) to work, and so it would be good to know what is what, before starting to remove.
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Core 3 Diskspace

Post by dirk »

Hi there are several options for you. First I recommend you to think or share with us what your desired system shall do. Then you can decide which packages are involved and which are obsolete.
The other way is that you create your own custom image. Have a look at imagebakery on our GitHub repository.
We unfortunately cannot create a M x N matrix containing all dependencies of all packages for you.
You can look up dependencies for a package with this command:

Code: Select all

apt-cache rdepends pictory
pictory
Reverse Depends:
  logiclab
You can easily find packages that have "revpi" in the name like so:

Code: Select all

dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | grep -i revpi
3       revpi-wallpaper
4       revpi-repo
5       revpi-tools
26      revpi7
149     revpi-firmware
3908    revpi-webstatus
18219   teamviewer-revpi
But there may be other KUNBUS packages on the system without "revpi" in the name like "piserial" or "pitest".
IFXE

Re: Core 3 Diskspace

Post by IFXE »

Ok thanks for your reply. I guess I just have to try removing packages until it starts to "hurt" and required systems no longer is working.

Is there by any chance a near coming RevPI revision, with a larger disk option? 4GB with only 1GB free on default install, is in the low end, and quite limiting don't you think?
User avatar
volker
Posts: 1046
Joined: 09 Nov 2016, 15:41

Re: Core 3 Diskspace

Post by volker »

We're sorry but this is not a question of RevPi but these are the limits given by Raspberry CM3. There will be variants coming up with more eMMC but the foundation has not yet given any information about their time line.
Unser RevPi Motto: Don't just claim it - make it!
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Core 3 Diskspace

Post by dirk »

Hi, you may use the imagebakery GitHub repository to create a minimal image that contains all the KUNBUS drivers as well.
Here is a step-by-step guide for you. I have used a Ubuntu 18.04 virtual machine to create the image.
Download RASPBIAN STRETCH LITE https://www.raspberrypi.org/downloads/raspbian/
http://media.kunbus.de/media/images/201 ... tretch.zip
http://downloads.raspberrypi.org/raspbi ... tretch.zip
You have to be root and have access to the internet to create the image.

Code: Select all

git clone https://github.com/RevolutionPi/imagebakery.git
cd imagebakery
unzip ../Download/2018-10-09-raspbian-stretch.zip 
apt-get install qemu-user-static binfmt-support
./shrink-image.sh 2018-10-09-raspbian-stretch-lite.img `date +%F`-raspian-shrunk.img
# on Ubuntu change #!/bin/sh => #!/bin/bash in customize_image.sh
./customize_image.sh `date +%F`-raspbian-shrunk.img
When you write the image you have about 2.3GB free space:

Code: Select all

pi@RevPi:~$ df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.5G  1.1G  2.3G  33% /
User avatar
fpf_baden
Posts: 20
Joined: 08 Jun 2017, 08:31
Location: Karlsruhe
Contact:

Re: Core 3 Diskspace

Post by fpf_baden »

Hi,

i have written a short documentation how to get Azure IoT-Edge running on an Revolution Pi Core 3.

https://github.com/FrankPfattheicher/IotEdgeRevPi

Regards Frank
IFXE

Re: Core 3 Diskspace

Post by IFXE »

Thank you Frank, for a very helpful write-up.

I did manage to get the Azure IoT Edge working on the device, and all was well running this https://github.com/Azure/iot-edge-opc-publisher module for publishing OPC data, until the GA release of the Azure IoT Edge. Since this release, I have not been able to successfully run this module on the Revolution PI 3 device. It runs well on regular Raspberry PI 3. I suspect this is due to the limited disk-space.

I made a full reinstall of the Stretch image, and tried to configure it to minimize the disk footprint (3.4GB used when all is installed), but to no avail. I have not tried with a supporting USB disk, and this is now next on my list. Problem I have with this solution is that it makes the system less robust, and less ideal as a product for mass-installation in remote locations.
prinzema
Posts: 1
Joined: 01 Apr 2019, 10:57

Re: Core 3 Diskspace

Post by prinzema »

Same issues here, since this post is 7 months old. Did you eventually find a solution for this?
IFXE wrote: 27 Aug 2018, 08:50 * I have not tried with a supporting USB disk, and this is now next on my list. Problem I have with this solution is that it makes the system less robust, and less ideal as a product for mass-installation in remote locations.
Post Reply