在server节点,在centos:latest镜像,创建名为c1的容器,将容器扩容至20G
1.先创建一个名为c1的容器,默认执行/usr/sbin/init
docker run -itd --name c1 centos /usr/sbin/init
2.查看容器存储卷信息
dmsetup table
#docker-8:3-135022760-2542d1a6c7e5f3cec939cb956f9cdc93199de0d1f4516191d4353115ead1f985: 0 20971520 thin 253:0 55
3.计算20个G的值
echo $((102410241024/512*20))
41943040
4.修改储存卷
echo 0 41943040 thin 253:0 55 | dmsetup load docker-8:3-135022760-2542d1a6c7e5f3cec939cb956f9cdc93199de0d1f4516191d4353115ead1f985
5.刷新储存卷
dmsetup resume docker-8:3-135022760-2542d1a6c7e5f3cec939cb956f9cdc93199de0d1f4516191d4353115ead1f985
6.查看
dmsetup table /dev/mapper/docker-8:3-135022760-2542d1a6c7e5f3cec939cb956f9cdc93199de0d1f4516191d4353115ead1f985