Docker Slow Ext4 Partition

TL;DR : you can’t, at least for now

Long Version:

Docker Slow Ext4 Partition

CentOS 7 though creates EXT4 filesystems with dtype=1 enabled by default. See explanation at What is dtype and why Docker overlayfs need it - Linuxer Pro. Worse thing is you can't fix it on existing CentOS 7 created XFS partitions. You need to recreate the filesystem if you setup CentOS 7 filesystem with XFS partitions! Next, create a mount point and mount the newly created ext4 partition file system. # mkdir /mnt/disk2-part1 # mount /dev/sdb1 //mnt/disk2-part1. Now using the df command, you can list all file systems on your system together with their sizes in a human readable format (-h), and their mount points and file system types (-T): # df -hT. Apr 16, 2017 Hence your host machine should have ext4 partition where docker is running and creating containers/ images from. $ sudo dockerd -storage-opt dm.basesize=50G. To let the changes take effect, you have to run the following commands: $ sudo service docker stop $ sudo rm -rf /var/lib/docker $ sudo service docker start.

So, i learning docker recently, and i notice that docker took quite a lot of space on my drive for just random image that i pull from dockerhub (yes, just for curiosity). I just being considerate my tiny weeny ssd write cycle. After my previous post on here about almost same problem, now i try to do that on linux.

/ has Docker images (via /var/lib/docker) which is the concern: docker can fill the root partition. /srv has Jenkins build results (large), zuul-merge repositories ( 25GB), integration.wikimedia.org docroot (small) We would want to shrink the volume group and create a new one for Docker images which would be at /srv/docker.

Docker Slow Ext4 Partition Free

After struggling with this problem for 2 days and much stack overflow later, the best solution (or most recommended) was

  1. Make a new file called daemon.json on /etc/docker
  2. And just fill it with this

Great, we’re done.

But wait

What ? okay, calm down, what could probably be the problem here, it mention about overlay stuff, what was that ?

So, apparently, docker use some kind of storage driver for writing to container writable layer. I’m not expert on docker yet, but in this case, probably docker was trying to write that image on our container, but because our container location was on ntfs file system, it has some problem.

The default storage driver being used was overlay2, this is supported for newest docker version. The storage drive that might work is vfs driver or overlayFS, but it might rather slow, as mentioned in this issue.

Apparently, there is something called backing-filesystem that are know for incompatible with docker distribution, ntfs was one of them (check here). Honestly, i din’t really need that fast, but I want it, because I can ;)

My solution ? Since i got 1 TB hard drive, i actually planned to convert whole drive filesystem to ext4 to fulfill my self perfectionist because i don’t like many partition on my drive. But since my drive was 60% occupied, that would take an ages (not really, but just so long). Fast solution, shrink main ntfs partition, create new ext4 partition.

Docker Slow Ext4 Partition Software

Done, now create a mount point for this drive, you can totally do that by changing file /etc/fstab, but because i want to make my life easier, just do that on Disk application.

and now change the daemon.json, but first stop the docker daemon

edit /etc/docker/daemon.json

restart the docker daemon

Yeahh, we’re done boys