centos7 增大/dev/mapper/centos-root 空间
自己虚拟机中安装的docker占用太大内存了,一天 重启vm之后docker容器启动不起来了,异常如下
[root@localhost /]# service docker start
Redirecting to /bin/systemctl start docker.service
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
[root@localhost /]# systemctl status 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 日 2020-09-27 18:05:14 CST; 5s ago
Docs: https://docs.docker.com
Process: 1805 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --data-root=/mydata/docker --pidflie=/mydata/docker/docker.pid (code=exited, status=1/FAILURE)
Main PID: 1805 (code=exited, status=1/FAILURE)
9月 27 18:05:12 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
9月 27 18:05:12 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
9月 27 18:05:12 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
9月 27 18:05:12 localhost.localdomain systemd[1]: docker.service failed.
9月 27 18:05:14 localhost.localdomain systemd[1]: docker.service holdoff time over, scheduling restart.
9月 27 18:05:14 localhost.localdomain systemd[1]: Stopped Docker Application Container Engine.
9月 27 18:05:14 localhost.localdomain systemd[1]: start request repeated too quickly for docker.service
9月 27 18:05:14 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
9月 27 18:05:14 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
9月 27 18:05:14 localhost.localdomain systemd[1]: docker.service failed.
- 原因分析
[root@localhost /]# sudo df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 4.0K 1.4G 1% /dev/shm
tmpfs 1.4G 9.5M 1.4G 1% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/mapper/centos-root 17G 17G 20K 100% /
/dev/sda1 1014M 203M 812M 20% /boot
tmpfs 283M 0 283M 0% /run/user/0
/dev/mapper/centos-root 占用100%,导致容器启动不起来。
解决方案:
这里采用增大vm硬盘空间的方法,具体操作如下:
1、vm 添加硬盘
完成之后,这里会多一个硬盘的配置
- shell里面执行如下命令即可:
,博主这里重启了linux,docker 启动不起来的问题就解决了,特此记录一下。
ps:参考博客: