环境:openshift v3.6.173.0.5
openshift上devicemapper与官方文档中的描述略有不同,在官方文档的描述中,容器使用的lvm文件系统挂载在/var/lib/devicemapper下,因此可以在/var/lib/devicemapper/Metadata中找到容器对应的devicemapper的配置信息,在/var/lib/devicemapper/mnt中可以看到容器的文件系统,描述如下:
The
/var/lib/docker/devicemapper/Metadata/
directory contains Metadata about the Devicemapper configuration itself and about each image and container layer that exist. Thedevicemapper
storage driver uses snapshots,and this Metadata include information about those snapshots. These files are in JSON format.The
/var/lib/devicemapper/mnt/
directory contains a mount point for each image and container layer that exists. Image layer mount points are empty,but a container’s mount point shows the container’s filesystem as it appears from within the container.
在openshfit中使用docker inspect查看一个容器的devicemapper信息如下,使用的块设备为 docker-253:0-101504694-13339a03e1b2fc605c83e915a439d8f87131b9e01d599750298a5eada849ae5f
@H_502_20@"GraphDriver": { Name": devicemapper,Data: { DeviceId29DeviceNamedocker-253:0-101504694-13339a03e1b2fc605c83e915a439d8f87131b9e01d599750298a5eada849ae5fDeviceSize10737418240 } },