Home >Operation and Maintenance >Docker >How to solve the error when upgrading docker to 1.9

How to solve the error when upgrading docker to 1.9

PHPz
PHPzOriginal
2023-04-04 10:41:16822browse

Docker is currently the leading containerization technology and is widely used by many companies in production environments due to its efficiency and ease of use. However, the Docker upgrade process sometimes encounters various problems. One of the common problems is errors during the upgrade process.

Many people have reported recently that they encountered problems when upgrading Docker to version 1.9. This article explains how to resolve this issue.

Problem Description

When executing the upgrade script, the following error message will be output:

FATA[0000] Error response from daemon: Cannot stop container: : Driver btrfs failed to remove root filesystem : Device or resource busy

After Docker was upgraded to 1.9, the file system used in the container was switched from AUFS to Btrfs due to changes in the underlying storage. During the process of switching file systems, sometimes the file system cannot be unmounted. At this point, the upgrade process cannot continue.

Solution

The following are some common solutions:

Method 1: Find and stop the process occupying the file system

Use the following command to find the occupation The process of this file system:

sudo fuser -m

Where, is the root directory of the Docker container. After executing this command, the PID of the process occupying the file system will be output.

Use the following command to stop the process:

sudo kill -9

Then, run the upgrade script again.

Method 2: Temporarily stop the file system

Use the following command to temporarily stop the Btrfs file system:

sudo umount -l

Then run Just upgrade the script.

Method 3: Stop all containers and delete the Btrfs file system

Use the following command to stop all containers and delete the Btrfs file system:

docker stop $(docker ps -a - q)
sudo rm -rf

Then run the upgrade script.

Note: Before deleting the Btrfs file system, please make sure all data has been backed up!

Summary

Encountering errors when upgrading Docker is a common problem. In this article, we introduce some solutions that may be useful to you. During the upgrade process, be sure to handle data with caution, back up your data, and back up your system before upgrading. This way, if something goes wrong, you can easily roll back to a previous state.

I hope this article can help you solve the problems that arise during the Docker upgrade process.

The above is the detailed content of How to solve the error when upgrading docker to 1.9. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to shut down dockerNext article:How to shut down docker