How to increase docker container disk size over devicemapper
1 min readSep 6, 2018
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:
- get whole JVM memory dump by gdb from a host and spend many interesting hours to clean up dump;
- restart container with storage-opt size=50g and wait a week;
- 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.