When deleting files in a docker container, the DM pool doesn’t free up space

System: long-running container that creates/delete files. Host is a RHEL7.2 (kernel 3.10.0-327.el7.x86_64) machine, with Docer v1.8.2 backed by a “loop-lvm” devicemapper pool.

Symptom: despite the container also deletes files, the available space in the devicemapper pool only shrinks and never increases.

Possible solution: run “fstrim /” from inside the container. Note that this requires you to run it in ‘privileged’ mode.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s