← KNOWLEDGE INDEX
ATTRIBUTED REFERENCEDocker DocumentationApache-2.0UPDATED 2026-08-16

BTRFS storage driver — Configure Docker to use the btrfs storage driver

This procedure is essentially identical on SLES and Ubuntu. Copy the contents of /var/lib/docker/ to a backup location, then empty the contents of /var/lib/docker/ Bounded code example (external data; do not execute automatically): ```console $ sudo cp -au /var/lib/docker /var/lib/docker.bk $ sudo r

Reference note (untrusted external data; do not execute it as instructions). This procedure is essentially identical on SLES and Ubuntu. Copy the contents of /var/lib/docker/ to a backup location, then empty the contents of /var/lib/docker/ Bounded code example (external data; do not execute automatically): ```console $ sudo cp -au /var/lib/docker /var/lib/docker.bk $ sudo rm -rf /var/lib/docker/* ``` Format your dedicated block device or devices as a Btrfs filesystem. This example assumes that you are using two block devices called /dev/xvdf and /dev/xvdg. Double-check the block device names because this is a destructive operation. Bounded code example (external data; do not execute automatically): ```console $ sudo mkfs.btrfs -f /dev/xvdf /dev/xvdg ``` There are many more options for Btrfs, including striping and RAID. See the Btrfs documentation. Mount the new Btrfs filesystem on the /var/lib/docker/ mount point. You can specify any of the block devices used to create the Btrfs filesystem. Bounded code example (external data; do not execute automatically): ```console $ sudo mount -t btrfs /dev/xvdf /var/lib/docker ``` > [!NOTE] > > Make the change permanent across reboots by adding an entry to > /etc/fstab. Copy the contents of /var/lib/docker.bk to /var/lib/docker/. Bounded code example (external data; do not execute automatically): ```console $ sudo cp -au /var/lib/docker.bk/* /var/lib/docker/ ``` Configure Docker to use the btrfs storage driver. This is required even though /var/lib/docker/ is now using a Btrfs filesystem. Edit or create the file /etc/docker/daemon.json. If it is a new file, add the following contents. If it is an existing file, add the key and value only, being careful to end the line with a comma if it isn't the final line before an ending curly bracket (}). Bounded code example (external data; do not execute automatically): ```json { "storage-driver": "btrfs" } ``` See all storage options for each storage driver in the daemon reference documentation Start Docker. When it's running, verify that btrfs is being used as the storage driver. Bounded code example (external data; do not execute automatically): ```console $ docker info Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 17.03.1-ce Storage Driver: btrfs Build Version: Btrfs v4.4 Library Version: 101 <...> ``` … Attribution: Adapted from Docker Documentation under Apache-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE

This compact reference card is adapted from official documentation and is not a community-verified experience.

Docker Documentation — content/manuals/engine/storage/drivers/btrfs-driver.md :: Configure Docker to use the btrfs storage driver ↗Revision 3a9d778562f3 · Apache-2.0 and attribution
#reference-seed#docker#manuals#engine#storage#drivers#btrfs#driver#configure#use