inotify_add_watch(7, /dev/dm-4, 10) failed: No such file or directory

centos7 docker 安装异常。

11月 12 15:04:49 localhost.localdomain systemd-udevd[7722]: inotify_add_watch(7, /dev/dm-4, 10) failed: No such file or directory

11月 12 15:04:49 localhost.localdomain dockerd[7818]: time="2018-11-12T15:04:49.222829501+08:00" level=info msg="Creating filesystem xfs on device docker-253:1-69583127-base, mkfs args: [-m crc=0,finobt=0 /dev/mapper/docker-253:1-

是因为 xfsprogs 版本太低了。

解决方法

yum update xfsprogs

error

11月 12 15:04:48 localhost.localdomain dockerd[7818]: time="2018-11-12T15:04:48.587795016+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42023ca30, CONNECTING" module=grpc
11月 12 15:04:48 localhost.localdomain dockerd[7818]: time="2018-11-12T15:04:48.588299915+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42023ca30, READY" module=grpc
11月 12 15:04:48 localhost.localdomain dockerd[7818]: time="2018-11-12T15:04:48.623036012+08:00" level=warning msg="Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or


11月 12 15:04:49 localhost.localdomain systemd-udevd[7722]: inotify_add_watch(7, /dev/dm-4, 10) failed: No such file or directory

11月 12 15:04:49 localhost.localdomain dockerd[7818]: time="2018-11-12T15:04:49.222829501+08:00" level=info msg="Creating filesystem xfs on device docker-253:1-69583127-base, mkfs args: [-m crc=0,finobt=0 /dev/mapper/docker-253:1-


11月 12 15:04:49 localhost.localdomain dockerd[7818]: time="2018-11-12T15:04:49.224451562+08:00" level=info msg="Error while creating filesystem xfs on device docker-253:1-69583127-base: exit status 1" storage-driver=devicemapper
11月 12 15:04:49 localhost.localdomain dockerd[7818]: time="2018-11-12T15:04:49.224500526+08:00" level=error msg="[graphdriver] prior storage driver devicemapper failed: exit status 1"
11月 12 15:04:49 localhost.localdomain dockerd[7818]: Error starting daemon: error initializing graphdriver: exit status 1
11月 12 15:04:49 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
11月 12 15:04:49 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.

参考连接

https://www.cnblogs.com/FoChen/p/8708932.html

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
要避免inotify_add_watch函数返回no such file or directory错误,需要确保要监视的目录存在。可以通过调用access或stat函数来判断目录是否存在,如果目录不存在,则可以先创建该目录。 以下是一个示例代码片段: ``` #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/inotify.h> #include <sys/stat.h> int main(int argc, char **argv) { int fd, wd; char *path = "/path/to/dir"; // 检查目录是否存在 struct stat st; if (stat(path, &st) == -1) { perror("stat"); exit(EXIT_FAILURE); } // 创建 inotify 实例 fd = inotify_init(); if (fd == -1) { perror("inotify_init"); exit(EXIT_FAILURE); } // 添加监视器 wd = inotify_add_watch(fd, path, IN_ALL_EVENTS); if (wd == -1) { perror("inotify_add_watch"); exit(EXIT_FAILURE); } // 等待事件发生 // ... // 移除监视器 inotify_rm_watch(fd, wd); // 关闭 inotify 实例 close(fd); return 0; } ``` 在上面的代码中,首先通过调用stat函数来检查要监视的目录是否存在。如果目录不存在,程序会输出一个错误信息并退出。如果目录存在,则继续创建inotify实例,并调用inotify_add_watch函数添加一个监视器。如果inotify_add_watch返回了no such file or directory错误,则说明要监视的目录不存在,程序会输出一个错误信息并退出。如果inotify_add_watch成功添加了监视器,则可以继续等待事件的发生。最后,需要调用inotify_rm_watch函数移除监视器,并关闭inotify实例。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值