9

I'm new to linux. I installed armbian to an sd card and everything works fine. The sd card is 64GB. Then I installed docker.io, docker-compose and portainer, nothing else.

When I check for disk space with lsblk:

    # lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0  59.5G  0 disk
├─mmcblk0p1  179:1    0   512M  0 part /boot
└─mmcblk0p2  179:2    0  58.4G  0 part /
mmcblk1      179:32   0  14.6G  0 disk
mmcblk1boot0 179:64   0     4M  1 disk
mmcblk1boot1 179:96   0     4M  1 disk
zram0        254:0    0    50M  0 disk /var/log
zram1        254:1    0 929.4M  0 disk [SWAP]

Then with df:

# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            796M     0  796M   0% /dev
tmpfs           186M  8.0M  178M   5% /run
/dev/mmcblk0p2   58G  2.2G   55G   4% /
tmpfs           930M     0  930M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           930M     0  930M   0% /tmp
/dev/mmcblk0p1  511M   59M  453M  12% /boot
/dev/zram0       49M  7.0M   38M  16% /var/log
overlay          58G  2.2G   55G   4% /var/lib/docker/overlay2/b28da5a318945ac7ae1d17d26a635edb9a662c6116dea37fb4f6c13e1c76d7d2/merged
tmpfs           186M     0  186M   0% /run/user/0

Why are there 2 remaining 55 GB (/dev/mmcblk0p2 and the overlay filesystem)? Does this mean that I can only use the 55 GB space on the /var/lib/docker/overlay2/.../merged folder?

Thank you

0

1 Answer 1

4

/dev/mmcblk0p2 is the root filesystem where your Linux distribution is installed.

Where 2.2GB is in use and 55GB is available.

/var/lib/docker/overlay2 directory is the location where Docker stores its images and containers.

Docker uses a copy-on-write file system for the storage, which creates a new layer on top of the existing file system.

This is the Docker overlay filesystem and the location you see with df -h

overlay          58G  2.2G   55G   4% /var/lib/docker/overlay2/b28da5a318945ac7ae1d17d26a635edb9a662c6116dea37fb4f6c13e1c76d7d2/merged

You have 55GB of storage available on your SD card to store files, install packages, and use Docker, etc..

You can change this path, to another directory, storage or disk if you want.

Docker storage drivers

Use the OverlayFS storage driver

The legacy overlay driver was used for kernels that did not support the “multiple-lowerdir” feature required for overlay2 All currently supported Linux distributions now provide support for this, and it is therefore deprecated.

Overlay in Docker

Docker uses the overlay filesystem to create images as well as to position the container layer on top of the image layers. When an image is downloaded, its layers are located inside the /var/lib/docker/overlay2 folder.

The merged folders are overlay filesystems, they take no disk space themselves, instead df reports the disk usage of the underlying filesysem, which in your case is /

/var/lib/docker/overlay2/*/merged take too much space than it should be

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .