0

I am a newcomer to this device and I was surprised to see 'No space left on device' today after having not installed too much on it.

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            216M     0  216M   0% /dev
tmpfs            49M  8.7M   40M  18% /run
/dev/mmcblk1p1  3.5G  3.3G     0 100% /
tmpfs           243M     0  243M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           243M     0  243M   0% /sys/fs/cgroup
tmpfs            49M     0   49M   0% /run/user/1000

sudo du -s -k /*
[sudo] password for debian: 
4       /bbb-uEnv.txt
6664    /bin
33104   /boot
0       /dev
5988    /etc
260592  /home
4       /ID.txt
270064  /lib
16      /lost+found
4       /media
4       /mnt
4       /nfs-uEnv.txt
186408  /opt
du: cannot access '/proc/28493': No such file or directory
du: cannot access '/proc/28532': No such file or directory
du: cannot access '/proc/28533/task/28533/fd/3': No such file or directory
du: cannot access '/proc/28533/task/28533/fdinfo/3': No such file or directory
du: cannot access '/proc/28533/fd/3': No such file or directory
du: cannot access '/proc/28533/fdinfo/3': No such file or directory
du: cannot access '/proc/28554': No such file or directory
du: cannot access '/proc/28557': No such file or directory
du: cannot access '/proc/28558': No such file or directory
du: cannot access '/proc/28560': No such file or directory
0       /proc
15480   /root
8824    /run
6480    /sbin
4       /srv
0       /sys
56      /tmp

du -s -k /var/log/*
2212976 /usr
413268  /var

du -s -k /var/log/*
0   /var/log/alternatives.log
40  /var/log/alternatives.log.1
216136  /var/log/apache2
84  /var/log/apt
792 /var/log/auth.log
144 /var/log/auth.log.1
104 /var/log/bootstrap.log
0   /var/log/btmp
4   /var/log/btmp.1
4824    /var/log/daemon.log
1892    /var/log/daemon.log.1
8   /var/log/debug
28  /var/log/debug.1
0   /var/log/dpkg.log
676 /var/log/dpkg.log.1
24  /var/log/faillog
4   /var/log/fontconfig.log
204 /var/log/kern.log
948 /var/log/kern.log.1
288 /var/log/lastlog
du: cannot read directory '/var/log/lightdm': Permission denied
4   /var/log/lightdm
1244    /var/log/messages
924 /var/log/messages.1
4   /var/log/roboticscape
5772    /var/log/syslog
200 /var/log/syslog.1
20  /var/log/syslog.2.gz
56  /var/log/syslog.3.gz
4   /var/log/syslog.4.gz
376 /var/log/syslog.5.gz
1048    /var/log/user.log
24  /var/log/user.log.1
792 /var/log/wtmp
140 /var/log/wtmp.1
0   /var/log/xinput_calibrator.pointercal.log
12  /var/log/Xorg.0.log
16  /var/log/Xorg.0.log.old

By running sudo find / -xdev -type f -size +100M, I discovered that the Apache log file is very large:

du /var/log/apache2/access.log.1
130784  /var/log/apache2/access.log.1

If this is indeed the cause, how can I prevent this ever happening again? I need my device to work consistently.

1

In order to disable and turn off the Apache logging just direct the log entries customlog and errorlog to /dev/null in the .conf file(s) for your site, probably inside /etc/apache2/sites-available/

Alternatively, if you wish to still keep some logging, you could set up a cron job that periodically cleans out the log files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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