github.com/olljanat/moby@v1.13.1/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  	 Base Device Size: 107.4 GB
    53  	 Data file: /dev/loop4
    54  	 Metadata file: /dev/loop4
    55  	 Data Space Used: 2.536 GB
    56  	 Data Space Total: 107.4 GB
    57  	 Data Space Available: 104.8 GB
    58  	 Metadata Space Used: 7.93 MB
    59  	 Metadata Space Total: 2.147 GB
    60  	 Metadata Space Available: 2.14 GB
    61  	 Udev Sync Supported: true
    62  	 Data loop file: /home/docker/devicemapper/devicemapper/data
    63  	 Metadata loop file: /home/docker/devicemapper/devicemapper/metadata
    64  	 Library Version: 1.02.82-git (2013-10-04)
    65  	[...]
    66  
    67  #### status items
    68  
    69  Each item in the indented section under `Storage Driver: devicemapper` are
    70  status information about the driver.
    71   *  `Pool Name` name of the devicemapper pool for this driver.
    72   *  `Pool Blocksize` tells the blocksize the thin pool was initialized with. This only changes on creation.
    73   *  `Base Device Size` tells the maximum size of a container and image
    74   *  `Data file` blockdevice file used for the devicemapper data
    75   *  `Metadata file` blockdevice file used for the devicemapper metadata
    76   *  `Data Space Used` tells how much of `Data file` is currently used
    77   *  `Data Space Total` tells max size the `Data file`
    78   *  `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.
    79   *  `Metadata Space Used` tells how much of `Metadata file` is currently used
    80   *  `Metadata Space Total` tells max size the `Metadata file`
    81   *  `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.
    82   *  `Udev Sync Supported` tells whether devicemapper is able to sync with Udev. Should be `true`.
    83   *  `Data loop file` file attached to `Data file`, if loopback device is used
    84   *  `Metadata loop file` file attached to `Metadata file`, if loopback device is used
    85   *  `Library Version` from the libdevmapper used
    86  
    87  ### About the devicemapper options
    88  
    89  The devicemapper backend supports some options that you can specify
    90  when starting the docker daemon using the `--storage-opt` flags.
    91  This uses the `dm` prefix and would be used something like `docker daemon --storage-opt dm.foo=bar`.
    92  
    93  These options are currently documented both in [the man
    94  page](../../../man/docker.1.md) and in [the online
    95  documentation](https://docs.docker.com/engine/reference/commandline/dockerd/#/storage-driver-options).
    96  If you add an options, update both the `man` page and the documentation.