docker devicemapper loop pool 扩容
2016-06-03 16:37
901 查看
1.List the sizes of the devices.
2.Truncate data file to the size of the metadata file (approximage 200GB).
3.Verify the file size changed.
4.Reload data loop device
5.Reload devicemapper thin pool.
a. Get the pool name first.
b. Dump the device mapper table first.
c. Calculate the real total sectors of the thin pool now.
d. Reload the thin pool with the new sector number
$ sudo ls -lh /var/lib/docker/devicemapper/devicemapper/ total 1175492 -rw------- 1 root root 100G Mar 30 05:22 data -rw------- 1 root root 2.0G Mar 31 11:17 metadata
2.Truncate data file to the size of the metadata file (approximage 200GB).
$ sudo truncate -s 214748364800 /var/lib/docker/devicemapper/devicemapper/data
3.Verify the file size changed.
$ sudo ls -lh /var/lib/docker/devicemapper/devicemapper/ total 1.2G -rw------- 1 root root 200G Apr 14 08:47 data -rw------- 1 root root 2.0G Apr 19 13:27 metadata
4.Reload data loop device
$ sudo blockdev --getsize64 /dev/loop0 107374182400 $ sudo losetup -c /dev/loop0 $ sudo blockdev --getsize64 /dev/loop0 214748364800
5.Reload devicemapper thin pool.
a. Get the pool name first.
$ sudo dmsetup status | grep pool docker-8:1-123141-pool: 0 209715200 thin-pool 91 422/524288 18338/1638400 - rw discard_passdown queue_if_no_space - The name is the string before the colon.
b. Dump the device mapper table first.
$ sudo dmsetup table docker-8:1-123141-pool 0 209715200 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing
c. Calculate the real total sectors of the thin pool now.
Change the second number of the table info (i.e. the disk end sector) as the new loop size is 200GB, change the second number to 419430400. 419430400=1024*1024*1024*200/512 块扇区
d. Reload the thin pool with the new sector number
$ sudo dmsetup suspend docker-8:1-123141-pool $ sudo dmsetup reload docker-8:1-123141-pool --table '0 419430400 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing' $ sudo dmsetup resume docker-8:1-123141-pool
相关文章推荐
- centos6.5上安装docker
- docker容器的网络信息查看
- openstack kilo-with-dokcer
- 在windows下的安装Docker的教程
- 8个你可能不知道的Docker知识
- 在Docker中自动化部署Ruby on Rails的教程
- 搭建基于Docker的PHP开发环境的详细教程
- 利用OpenVSwitch在多台主机上部署Docker的教程
- ubuntu14.04+docker的安装及使用
- Docker 清理命令集锦
- 再Docker中架设完整的WordPress站点全攻略
- 基于 Docker 开发 NodeJS 应用
- 使用Docker来加速构建Android应用的基本部署思路解析
- 在Docker上部署Python的Flask框架的教程
- 在Docker上开始部署Python应用的教程
- 详解在Python和IPython中使用Docker
- python脚本监控docker容器
- 使用IPython来操作Docker容器的入门指引
- Alpine Linux Repository本地镜像制作
- OSX下brew安装docker(boot2docker)