openHABian /dev/root takes all space

Hello, I just tried raspberry pi 3 for my OH server, I used a windows machine that died recently and copy entire conf and userdata folder for about 200mb with cache and tmp folder copied.

But now I cannot update anything because disk is full, and df -h command shows that /dev/root is taking all the space available (15GB used on 16GB card, 53MB free, 100% usage).

I installed mosquitto and influxdb + grafana but not yet setup for influxdb and often see error on OH frontail complaining no directory to write data. I only persist on temp & humidity change (3 device each), lights on/off state 16 device, and door open/close state 1 device for every change and every minute.

what is the possible culprit that may take all of my SD card space?

You will have to lotok and see what is taking up the most space.

https://www.google.com/amp/s/www.tecmint.com/find-top-large-directories-and-files-sizes-in-linux/amp/

It is unlikely that any of these services is the culprit unless there is something else wrong. My first guess is that your SD card is failing and because of that your log files are not rotating. When the sd card on one of my Pi’s failed I didn’t discover the problem until syslog filled up my root partition.

I had the problem that the integrated version control etckeeper was logging every change to local sd card - also the (big) changes on a mounted HDD. This filled my SD after a few days so I had to disable etckeeper.

Finally I found out what takes all space. It was because I run command apt-get update

It downloaded gigabytes of data. How can I prevent apt-get update from downloading gigabytes of data? I do not add any repo apart from my previous attempt to install influxdb, grafana, and mosquitto manually and found out later that openhabian-config offers that optional install

I have never encountered apt-get update downloading even megabytes of data. All apt-get update does is download the list of what packages are available and their versions. It doesn’t download actual programs.

There is something severely wrong with your OS it the SD card or both because I can think of no scenario where apt-get update would download that much.

do you suggest to reflash the SD card and reinstall everything? I’m quite frustrated because I cannot run stable OH 2.1.0. No UI is showing unless I install 2.2.0 snapshot

If the problem is indeed the SD card I would not trust that SD card and get
a new one. Some people have had luck reformatting and flashing a card but
they do physically wear out and at some point it will not work.

It was a brand new sandisk SD card from reputable seller.
I reflashed the card and now it works for OH 2.1.0. Thank you all