1

I've already tried using apt-get clean, but the usage of /dev/mmcb1k1p1 went from 100% to 99%.

This are the results that I get with df:

Filesystem     Type      Size  Used Avail Use% Mounted on  
udev           devtmpfs  215M     0  215M   0% /dev
tmpfs          tmpfs      49M  5.9M   43M  13% /run
/dev/mmcblk1p1 ext4      3.5G  3.2G   52M  99% /
tmpfs          tmpfs     242M     0  242M   0% /dev/shm
tmpfs          tmpfs     5.0M  4.0K  5.0M   1% /run/lock
tmpfs          tmpfs     242M     0  242M   0% /sys/fs/cgroup
tmpfs          tmpfs      49M     0   49M   0% /run/user/0

du:

root@beaglebone:/# ls | xargs du -hs
4.0K    bbb-uEnv.txt
9.7M    bin
26M     boot
0       dev
5.4M    etc
848K    home
4.0K    ID.txt
245M    lib
16K     lost+found
4.0K    media
4.0K    mnt
4.0K    nfs-uEnv.txt
156M    opt
du: cannot access 'proc/2356/task/2356/fd/3': No such file or directory
du: cannot access 'proc/2356/task/2356/fdinfo/3': No such file or directory
du: cannot access 'proc/2356/fd/3': No such file or directory
du: cannot access 'proc/2356/fdinfo/3': No such file or directory
0       proc
60K     root
5.9M    run
6.5M    sbin
4.0K    srv
0       sys
48K     tmp
2.5G    usr
296M    var

In /usr:

root@beaglebone:/usr# ls | xargs du -hs
278M    bin
4.0K    games
45M     include
992M    lib
187M    local
6.2M    sbin
1017M   share
4.0K    src

In /var:

root@beaglebone:/var# ls | xargs du -hs
48K     backups
34M     cache
92M     lib
8.0K    local
0       lock
160M    log
4.0K    mail
4.0K    opt
0       run
28K     spool
11M     tmp
8.0K    www

So, I can deduce that the there's a problem with the size of those directories, but I am still new to Linux and I don't have a lot of experience managing the file system. Any detailed ideas to solve this issue?

Edit: Showing the contents of fdisk -l:

root@beaglebone:~# fdisk -l
Disk /dev/mmcblk1: 3.6 GiB, 3825205248 bytes, 7471104 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x336593c4

Device         Boot Start     End Sectors  Size Id Type
/dev/mmcblk1p1 *     8192 7471103 7462912  3.6G 83 Linux

Disk /dev/mmcblk1boot1: 2 MiB, 2097152 bytes, 4096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mmcblk1boot0: 2 MiB, 2097152 bytes, 4096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Edit2: Contents of /usr/share

root@beaglebone:/usr/share# ls | xargs du -hs
388K    aclocal
160K    aclocal-1.15
8.0K    adduser
944K    alsa
1.7M    apache2
8.0K    appdata
204K    applications
36K     apport
12K     apps
1.7M    autoconf
1000K   automake-1.15
16K     avahi
36K     base-files
12K     base-passwd
2.3M    bash-completion
728K    beagle-tester
12K     binfmts
54M     bone101
528K    bug
12K     build-essential
620K    ca-certificates
432K    calendar
12K     chromium
256K    common-licenses
1.4M    consolefonts
48K     console-setup
112K    consoletrans
16K     cryptsetup
196K    dbus-1
28K     debconf
36K     debhelper
8.0K    debianutils
12K     defaults
6.4M    desktop-base
212K    desktop-directories
524K    dh-python
2.8M    dict
36K     dictionaries-common
8.0K    dnsmasq
8.0K    dnsmasq-base
124M    doc
92K     doc-base
56K     dpkg
344K    emacs
8.0K    file
12K     flash-kernel
156K    fontconfig
156M    fonts
56K     galternatives
108K    gcc-6
56K     gconf
44K     GConf
28K     gcr-3
2.7M    gdal
24K     gdb
2.9M    gdcm-2.6
24K     gettext
12K     ghostscript
128K    git-core
324K    gitweb
8.0K    gksu
268K    glib-2.0
12K     glvnd
24K     gnome-background-properties
12K     gnome-control-center
28K     gnome-online-accounts
8.0K    gnupg
1.6M    groff
320K    gtk-doc
132K    gvfs
1.7M    hal
80K     help
9.7M    i18n
116M    icons
8.0K    images
1.2M    info
316K    initramfs-tools
12K     iptables
4.0K    java
548K    javascript
12K     kdm
64K     keyrings
8.0K    libc-bin
12K     libdrm
160K    libfm
464K    libfm-qt
28K     libgksu
736K    libgphoto2
4.0K    libsensors4
560K    libthai
384K    libtool
836K    libwacom
20K     lightdm
872K    lintian
149M    locale
8.4M    lxqt
18M     man
32K     maven-repo
44K     menu
64K     metainfo
5.5M    mime
420K    misc
324K    mjpg-streamer
8.0K    mysql-common
180K    nano
4.0K    nodejs
8.0K    numpy
8.0K    numpy3
9.7M    opencv
468K    OpenCV
456K    openmpi
12K     openssh
16K     p11-kit
44K     pam
20K     pam-configs
60K     pastebin.d
564K    pcmanfm-qt
20M     perl
5.0M    perl5
12K     perl-openssl-defaults
116K    pixmaps
60K     pkgconfig
4.0K    pkg-config-crosswrapper
4.0K    pkg-config-dpkghook
24K     plasma
1.9M    plymouth
612K    polkit-1
12M     poppler
20K     ppp
15M     proj
176K    pyshared
292K    python
148K    python3
1.6M    python-wheels
11M     qt5
212K    qterminal
156K    qtermwidget5
12K     rcn-ee-archive-keyring
8.0K    readline
20K     robotcontrol
324K    screen
92K     sgml
1.2M    sounds
8.0K    ssl-cert
28K     state
16K     systemd
12K     systemtap
20K     tabset
32K     tasksel
3.6M    tcltk
4.0K    terminfo
116K    tesseract-ocr
4.7M    themes
212M    ti
24K     upstart
24K     usb_modeswitch
31M     vim
4.0K    wallpapers
5.6M    X11
8.0K    xfwm4
8.0K    xgreeters
24K     xml
12K     xsessions
3.4M    zoneinfo
128K    zsh
2
  • Can you post the output of the command fdisk -l? From there we can see the size of the disk/sd card.
    – dexter
    Commented Apr 5, 2020 at 11:49
  • The output is now included in the edit.
    – Mario
    Commented Apr 5, 2020 at 17:38

1 Answer 1

2

You can safely free some space if you delete content of some log files (if you do not need information from there). Identify the log that are bigger than expected (in this case everything that is bigger than 1MB) with #du -sh /var/log/*, first check the content, it might have some useful information. You can empty log file writing null to it, e.g

#cat /dev/null > /var/log/some_logfile.log.

Some applications need setting logging, so the log files they generate can be rotated, archived or deleted all according to your need.

/usr/ directorium of 2.5G is most probably the biggest problem. Have you downloaded something there? Check /usr/share/. Have you downloaded some archive (.zip, .gzip, .tar ...) at that location, and after that extracted it? If yes, than you can safely delete archive and leave just expanded files/dirs.

EDIT:

I've just realized that BBB comes with image that is close to 4GB. You could get some space on the disk by deleting some files, but you will get into the same situation soon or a later, so go for 8GB SD card. There is no much room for creating much free space now, you could try to:

  1. Reduce journal log size, first check current size on disk #journalctl --disk-usage
    You can set max usage to 1MB with #journalctl --vacuum-size=1M
  2. Delete all logs in /var/log/ exceeding 1MB.
  3. Check what is in /opt/ and if you can get some free space of those 156M
3
  • I included an edit with the contens of /usr/share. Before this problem, I tried setting up CPAN for the first time, according to help.dreamhost.com/hc/en-us/articles/217716877-CPAN from steps 4 to 8, after that run the command install Email::Valid, and then I got the message that there wasn't enough space. Do you think that could be the cause of the issue? If so, how to I find what files from /usr/share are safe to delete? That's a tricky part.
    – Mario
    Commented Apr 5, 2020 at 19:47
  • I think that in this situation you do not have much options, except to get 8GB SD card. I have edited my post.
    – dexter
    Commented Apr 5, 2020 at 20:55
  • Using a micro-SD to card to increase memory solves the problem. Considering these tips to reduce memory usage in the future, anyway.
    – Mario
    Commented Apr 8, 2020 at 20:02

You must log in to answer this question.