How to Remove Dockers and Configure with Btrfs? Dockers

Btrfs is the next generation filesystem that supports advanced storage technologies. Btrfs is a good fit for Docker and is included in the Linux kernel.

Btrfs storage driver has many features for image and container management. Some of these features are block-level operations, thin provisioning, copy-on-write snapshots and easy administration. It can easily combine multiple physical block devices into a single Btrfs filesystem

The first step is to install Btrfs and make sure the volume is formatted as Btrfs. The next step is to clean all dockers and images

The following command deletes all containers

                # sudodockerrm $(sudodockerps –a –q)

The following command deletes all images

                # sudodockerrmi $(sudodocker images –q)

The next step is to ensure you have Btrfs on your system

# sudo cat /proc/filesystems | grep btrfs

The next step is to stop the docker service

# sudo service docker stop

The next step is to create a backup of your docker settings

                # sudo mv /var/lib/docker /var/lib/docker.bak

The next step is to create a sub volume from the existing btrfs

# btrfssubvolume create /archive/dockers

Note: We would recoomend to use dedicated disk for this

The next step is to create a symbolic link

                # ln –s /archive/dockers /var/lib/docker

The next step is to copy the backup data to the new location

                # cp –rp /var/lib/docker.bak/* /var/lib/docker/

The next step is to configure the docker to use the btrfs storage driver. We would need to edit or create the file /etc/docker/daemon.json file even though /var/lib/docker is using btrfs file system

{

“storage-driver”: “btrfs”

}

The next step is to save the file and restart the docker service.

# Start docker service

                # sudo service docker start

The following step is to check if docker is running with docker support

# sudodocker info | grep “Storage Driver”

The following command checks the volume created

# btrfssubvolume list /var/liv/docker | grep dockers | grep docker

At Velan, our server support engineers can help you remove the dockers and configure with btrfs. We troubleshoot problems like these for our clients every day. If you are interested in our service, please fill the Quick connect form to get in touch with us

Credentials

Quick Connect With Us


    captcha
    reload