How to increase docker container disk size over devicemapper

Kirill A. Korinsky
Sep 6, 2018 · 1 min read

Well… sometimes you would like to debug something inside your container.

Let’s image you have a bug that created a memory leak of your application after a lot of hours… let say the week.

When you try to get a memory dump, you realized that your docker container hasn’t got enough space. It has default 10Gb when you need at least 50gb.

You have a three option:

  1. get whole JVM memory dump by gdb from a host and spend many interesting hours to clean up dump;
  2. restart container with storage-opt size=50g and wait a week;
  3. or you can increase disc size on the air.

I love 3rd option, and I’d like to share with you how to do this.

Comments:

  • at line 4 I calculated how many blocks 50gb are;
  • at line 8 I write dm table by hand, here I keep in mind that pool should have enough space. It has 100gb by default;
  • at line 12 I use XFS because my container uses XFS.

Kirill A. Korinsky

Written by

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade