Posted by & filed under Uncategorized.

Background

The Docker overlay2 storage driver requires the xfs d_type feature to functioning correctly.

That means the xfs filesystem needs to be created with mkfs.xfs -n ftype=1 /path/to/dev

Unfortunately, that is not the default in RHEL/Centos7. So you end up with an unstable Docker install.

See the output of xfs_info and look for ftype=0

If you see that, then you are in a bit of trouble. You may not hit any bugs for a while..

Fix:

First the bad news. You can’t just modify the existing xfs filesystem. You need a new one.

  1. Format the new device with mkfs.xfs -n ftype=1 /path/to/dev and then mount it.
  2. Stop docker.
  3. rsync -a /var/lib/docker/* /path/to/dev to copy all of the docker storage to the new root.
  4. edit the docker.service file /etc/systemd/system/multi-user.target.wants/docker.service and add
    -g /new/path to the ExecStart line.
  5. Start Docker
  6. Verify with df and docker info that the new docker root is being used.