[Configure direct-lvm mode for production](#configure-direct-lvm-mode-for-production).
1. Stop Docker.
```console
$ sudo systemctl stop docker
```
2. Edit `/etc/docker/daemon.json`. If it does not yet exist, create it. Assuming
that the file was empty, add the following contents.
```json
{
"storage-driver": "devicemapper"
}
```
See all storage options for each storage driver in the
[daemon reference documentation](/reference/cli/dockerd/#options-per-storage-driver)
Docker does not start if the `daemon.json` file contains badly-formed JSON.
3. Start Docker.
```console
$ sudo systemctl start docker
```
4. Verify that the daemon is using the `devicemapper` storage driver. Use the
`docker info` command and look for `Storage Driver`.
```console
$ docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 17.03.1-ce
Storage Driver: devicemapper
Pool Name: docker-202:1-8413957-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 11.8 MB
Data Space Total: 107.4 GB
Data Space Available: 7.44 GB
Metadata Space Used: 581.6 KB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.147 GB
Thin Pool Minimum Free Space: 10.74 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/data
Metadata loop file: /var/lib/docker/devicemapper/metadata
Library Version: 1.02.135-RHEL7 (2016-11-16)
<...>
```
This host is running in `loop-lvm` mode, which is **not** supported on
production systems. This is indicated by the fact that the `Data loop file`
and a `Metadata loop file` are on files under
`/var/lib/docker/devicemapper`. These are loopback-mounted
sparse files. For production systems, see
[Configure direct-lvm mode for production](#configure-direct-lvm-mode-for-production).
### Configure direct-lvm mode for production
Production hosts using the `devicemapper` storage driver must use `direct-lvm`
mode. This mode uses block devices to create the thin pool. This is faster than
using loopback devices, uses system resources more efficiently, and block
devices can grow as needed. However, more setup is required than in `loop-lvm`
mode.
After you have satisfied the [prerequisites](#prerequisites), follow the steps
below to configure Docker to use the `devicemapper` storage driver in
`direct-lvm` mode.
> [!WARNING]
> Changing the storage driver makes any containers you have already
> created inaccessible on the local system. Use `docker save` to save containers,
> and push existing images to Docker Hub or a private repository, so you do not
> need to recreate them later.
#### Allow Docker to configure direct-lvm mode
Docker can manage the block device for you, simplifying configuration of `direct-lvm`
mode. **This is appropriate for fresh Docker setups only.** You can only use a
single block device. If you need to use multiple block devices,
[configure direct-lvm mode manually](#configure-direct-lvm-mode-manually) instead.
The following new configuration options are available:
| Option | Description | Required? | Default | Example |
|:--------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------|:--------|:-----------------------------------|
| `dm.directlvm_device` | The path to the block device to configure for `direct-lvm`. | Yes | | `dm.directlvm_device="/dev/xvdf"` |