github.com/mheon/docker@v0.11.2-0.20150922122814-44f47903a831/daemon/graphdriver/devmapper/README.md (about) 1 ## devicemapper - a storage backend based on Device Mapper 2 3 ### Theory of operation 4 5 The device mapper graphdriver uses the device mapper thin provisioning 6 module (dm-thinp) to implement CoW snapshots. The preferred model is 7 to have a thin pool reserved outside of Docker and passed to the 8 daemon via the `--storage-opt dm.thinpooldev` option. 9 10 As a fallback if no thin pool is provided, loopback files will be 11 created. Loopback is very slow, but can be used without any 12 pre-configuration of storage. It is strongly recommended that you do 13 not use loopback in production. Ensure your Docker daemon has a 14 `--storage-opt dm.thinpooldev` argument provided. 15 16 In loopback, a thin pool is created at `/var/lib/docker/devicemapper` 17 (devicemapper graph location) based on two block devices, one for 18 data and one for metadata. By default these block devices are created 19 automatically by using loopback mounts of automatically created sparse 20 files. 21 22 The default loopback files used are 23 `/var/lib/docker/devicemapper/devicemapper/data` and 24 `/var/lib/docker/devicemapper/devicemapper/metadata`. Additional metadata 25 required to map from docker entities to the corresponding devicemapper 26 volumes is stored in the `/var/lib/docker/devicemapper/devicemapper/json` 27 file (encoded as Json). 28 29 In order to support multiple devicemapper graphs on a system, the thin 30 pool will be named something like: `docker-0:33-19478248-pool`, where 31 the `0:33` part is the minor/major device nr and `19478248` is the 32 inode number of the `/var/lib/docker/devicemapper` directory. 33 34 On the thin pool, docker automatically creates a base thin device, 35 called something like `docker-0:33-19478248-base` of a fixed 36 size. This is automatically formatted with an empty filesystem on 37 creation. This device is the base of all docker images and 38 containers. All base images are snapshots of this device and those 39 images are then in turn used as snapshots for other images and 40 eventually containers. 41 42 ### Information on `docker info` 43 44 As of docker-1.4.1, `docker info` when using the `devicemapper` storage driver 45 will display something like: 46 47 $ sudo docker info 48 [...] 49 Storage Driver: devicemapper 50 Pool Name: docker-253:1-17538953-pool 51 Pool Blocksize: 65.54 kB 52 Data file: /dev/loop4 53 Metadata file: /dev/loop4 54 Data Space Used: 2.536 GB 55 Data Space Total: 107.4 GB 56 Data Space Available: 104.8 GB 57 Metadata Space Used: 7.93 MB 58 Metadata Space Total: 2.147 GB 59 Metadata Space Available: 2.14 GB 60 Udev Sync Supported: true 61 Data loop file: /home/docker/devicemapper/devicemapper/data 62 Metadata loop file: /home/docker/devicemapper/devicemapper/metadata 63 Library Version: 1.02.82-git (2013-10-04) 64 [...] 65 66 #### status items 67 68 Each item in the indented section under `Storage Driver: devicemapper` are 69 status information about the driver. 70 * `Pool Name` name of the devicemapper pool for this driver. 71 * `Pool Blocksize` tells the blocksize the thin pool was initialized with. This only changes on creation. 72 * `Data file` blockdevice file used for the devicemapper data 73 * `Metadata file` blockdevice file used for the devicemapper metadata 74 * `Data Space Used` tells how much of `Data file` is currently used 75 * `Data Space Total` tells max size the `Data file` 76 * `Data Space Available` tells how much free space there is in the `Data file`. If you are using a loop device this will report the actual space available to the loop device on the underlying filesystem. 77 * `Metadata Space Used` tells how much of `Metadata file` is currently used 78 * `Metadata Space Total` tells max size the `Metadata file` 79 * `Metadata Space Available` tells how much free space there is in the `Metadata file`. If you are using a loop device this will report the actual space available to the loop device on the underlying filesystem. 80 * `Udev Sync Supported` tells whether devicemapper is able to sync with Udev. Should be `true`. 81 * `Data loop file` file attached to `Data file`, if loopback device is used 82 * `Metadata loop file` file attached to `Metadata file`, if loopback device is used 83 * `Library Version` from the libdevmapper used 84 85 ### About the devicemapper options 86 87 The devicemapper backend supports some options that you can specify 88 when starting the docker daemon using the `--storage-opt` flags. 89 This uses the `dm` prefix and would be used something like `docker daemon --storage-opt dm.foo=bar`. 90 91 These options are currently documented both in [the man 92 page](../../../man/docker.1.md) and in [the online 93 documentation](https://docs.docker.com/reference/commandline/daemon/#docker- 94 execdriver-option). If you add an options, update both the `man` page and the 95 documentation.