<p>I'm trying to install Kubernetes on CentOS 7.7, therefore, I have to install docker first.
I followed <a href="https://kubernetes.io/docs/setup/production-environment/container-runtimes/#docker" rel="nofollow noreferrer">Kubernetes Documentation</a> to install docker-ce and modify daemon.json file.</p>
<pre><code>$ yum install yum-utils device-mapper-persistent-data lvm2
$ yum-config-manager --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
$ yum update &amp;&amp; yum install \
    containerd.io-1.2.10 \
    docker-ce-19.03.4 \
    docker-ce-cli-19.03.4
$ mkdir /etc/docker
$ cat &gt; /etc/docker/daemon.json &lt;&lt;EOF
  {
    &quot;exec-opts&quot;: [&quot;native.cgroupdriver=systemd&quot;],
    &quot;log-driver&quot;: &quot;json-file&quot;,
    &quot;log-opts&quot;: {
      &quot;max-size&quot;: &quot;100m&quot;
    },
    &quot;storage-driver&quot;: &quot;overlay2&quot;,
    &quot;storage-opts&quot;: [
      &quot;overlay2.override_kernel_check=true&quot;
    ]
  }
  EOF

$ mkdir -p /etc/systemd/system/docker.service.d
$ systemctl daemon-reload
$ systemctl start docker
</code></pre>
<p>When started docker service, it said:</p>
<pre><code>Job for docker.service failed because the control process exited with error code. See &quot;systemctl status docker.service&quot; and &quot;journalctl -xe&quot; for details.
</code></pre>
<pre><code>$ systemctl status -l docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Tue 2020-01-07 14:44:11 UTC; 7min ago
     Docs: https://docs.docker.com
  Process: 9879 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 9879 (code=exited, status=1/FAILURE)

Jan 07 14:44:09 love61y2222c.mylabserver.com systemd[1]: Failed to start Docker Application Container Engine.
Jan 07 14:44:09 love61y2222c.mylabserver.com systemd[1]: Unit docker.service entered failed state.
Jan 07 14:44:09 love61y2222c.mylabserver.com systemd[1]: docker.service failed.
Jan 07 14:44:11 love61y2222c.mylabserver.com systemd[1]: docker.service holdoff time over, scheduling restart.
Jan 07 14:44:11 love61y2222c.mylabserver.com systemd[1]: Stopped Docker Application Container Engine.
Jan 07 14:44:11 love61y2222c.mylabserver.com systemd[1]: start request repeated too quickly for docker.service
Jan 07 14:44:11 love61y2222c.mylabserver.com systemd[1]: Failed to start Docker Application Container Engine.
Jan 07 14:44:11 love61y2222c.mylabserver.com systemd[1]: Unit docker.service entered failed state.
Jan 07 14:44:11 love61y2222c.mylabserver.com systemd[1]: docker.service failed.

</code></pre>
<pre><code>$ journalctl -xe
.
.
-- Unit docker.service has begun starting up.
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: time=&quot;2020-01-07T15:28:25.722780008Z&quot; level=info msg=&quot;Starting up&quot;
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: time=&quot;2020-01-07T15:28:25.728447514Z&quot; level=info msg=&quot;parsed scheme: \&quot;unix\&quot;&quot; module=grpc
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: time=&quot;2020-01-07T15:28:25.728479813Z&quot; level=info msg=&quot;scheme \&quot;unix\&quot; not registered, fallback to default scheme&quot; module=
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: time=&quot;2020-01-07T15:28:25.728510943Z&quot; level=info msg=&quot;ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: time=&quot;2020-01-07T15:28:25.728526075Z&quot; level=info msg=&quot;ClientConn switching balancer to \&quot;pick_first\&quot;&quot; module=grpc
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: time=&quot;2020-01-07T15:28:25.732325726Z&quot; level=info msg=&quot;parsed scheme: \&quot;unix\&quot;&quot; module=grpc
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: time=&quot;2020-01-07T15:28:25.733844225Z&quot; level=info msg=&quot;scheme \&quot;unix\&quot; not registered, fallback to default scheme&quot; module=
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: time=&quot;2020-01-07T15:28:25.733880664Z&quot; level=info msg=&quot;ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: time=&quot;2020-01-07T15:28:25.733898044Z&quot; level=info msg=&quot;ClientConn switching balancer to \&quot;pick_first\&quot;&quot; module=grpc
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: time=&quot;2020-01-07T15:28:25.743421350Z&quot; level=warning msg=&quot;Using pre-4.0.0 kernel for overlay2, mount failures may require
Jan 07 15:28:25 love61y2223c.mylabserver.com dockerd[29628]: failed to start daemon: error initializing graphdriver: overlay2: the backing xfs filesystem is formatted without d_type
Jan 07 15:28:25 love61y2223c.mylabserver.com systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Jan 07 15:28:25 love61y2223c.mylabserver.com systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Jan 07 15:28:25 love61y2223c.mylabserver.com systemd[1]: Unit docker.service entered failed state.
Jan 07 15:28:25 love61y2223c.mylabserver.com systemd[1]: docker.service failed.
</code></pre>
<p>Could anyone tell me why docker service start failed after modifying daemon.json file? And how to specify <code>cgroupdriver</code>, default <code>log-driver</code> and default <code>storage-driver</code> in the right way?</p>
<p>Any suggestion will be greatly appreciated.
Thanks.</p>

<p>This error is pointing to an issue forcing docker to use overlay2 without the proper backing filesystem:</p>

<pre><code>failed to start daemon: error initializing graphdriver: overlay2: the backing xfs filesystem is formatted without d_type
</code></pre>

<p>See docker's table for details on backing filesystem requirements for the different storage drivers: <a href="https://docs.docker.com/storage/storagedriver/#supported-backing-filesystems" rel="nofollow noreferrer">https://docs.docker.com/storage/storagedriver/#supported-backing-filesystems</a></p>

<p>The fix is to remove the storage driver settings, or fix the backing filesystem with the needed options to support overlay2:</p>

<pre><code>  {
    "exec-opts": ["native.cgroupdriver=systemd"],
    "log-driver": "json-file",
    "log-opts": {
      "max-size": "100m"
    }
  }
</code></pre>

<p>For details on changing the xfs options, that appears to require rebuilding the filesystem. See <a href="https://superuser.com/a/1321963/587488">this answer</a> for more details on the needed steps.</p>
