Docker daemon 无法启动: does not match with stored UUID错误解决办法

  • 内容
  • 评论
  • 相关

Docker daemon 无法启动: does not match with stored UUID错误

             最近做项目,遇到Docker daemon 无法启动: does not match with stored UUID错误的问题,经过上网查找资料解决了问题,这里记录下解决办法。

Docker 默认使用loop设备存储镜像。使用/var/lib/docker存储。但是当根分区不够大的时候(Centos7默认安装只有50G),那就麻烦了。

这里提供下修改方法(以centos7操作系统为例):

1.  systemctl stop docker

2.  mount   /dev/sdb1  /tmp

3.  cp -arf /var/lib/docker/*  /tmp

4.  rm -rf  /var/lib/docker

5.  umount /tmp;   mount /dev/sdb1  /var/lib/docker

6.  systemctl start docker

如果执行第六步骤的时候报错:

Jan 15 17:00:30 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
Jan 15 17:00:30 localhost.localdomain systemd[1]: docker.service failed.
lines 2597-2655/2655 (END)
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27+08:00" level=warning msg="The \"-g / --graph\" flag is deprecated. Please use \"--data-root\" instead"
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.982476916+08:00" level=info msg="parsed scheme: \"unix\"" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.982526690+08:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.982600236+08:00" level=info msg="parsed scheme: \"unix\"" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.982615267+08:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.986053880+08:00" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///run/containerd/containerd.sock 0  <nil>}]" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.986102853+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.986394566+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42061d490, CONNECTING" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.985155321+08:00" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///run/containerd/containerd.sock 0  <nil>}]" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.986467572+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.988159759+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42061d490, READY" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.990534935+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4208ac190, CONNECTING" module=grpc
Jan 15 17:00:27 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:27.991171044+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4208ac190, READY" module=grpc
Jan 15 17:00:28 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:28.050116116+08:00" level=warning msg="Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man dockerd` to refer to
Jan 15 17:00:28 localhost.localdomain dockerd[2917]: time="2019-01-15T17:00:28.169189295+08:00" level=error msg="[graphdriver] prior storage driver devicemapper failed: devmapper: Base Device UUID and Filesystem verification failed: devmapper: Current Base De
Jan 15 17:00:28 localhost.localdomain dockerd[2917]: Error starting daemon: error initializing graphdriver: devmapper: Base Device UUID and Filesystem verification failed: devmapper: Current Base Device UUID:81709348-f773-4b2d-98ac-996346416c62 does not match
Jan 15 17:00:28 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Jan 15 17:00:28 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.

image

那么按照下列方法修改:

stored UUID 存储在vi /data/lib/docker/devicemapper/metadata/deviceset-metadata 里面。 替换成Current Base Device UUID即可。

image