名称

podman-system-reset - 将存储重置回初始状态

简介

podman system reset [选项]

描述

podman system reset 删除所有 Pod、容器、镜像、网络、卷和机器。它还删除已配置的 graphRoot 和 runRoot 目录。请确保这些目录未设置为某些重要目录。

此命令必须在更改 containers.confstorage.conf 文件中的以下任何字段之前运行:driverstatic_dirtmp_dirvolume_path

podman system reset 读取当前配置并尝试删除所有相关配置。如果管理员首先修改了配置文件,podman system reset 可能无法清理之前的存储。

podman system reset 不会重新启动 podman.service 和 podman.socket systemd 单元。运行此命令后,您可能需要手动重新启动它们。

选项

--force, -f

不提示确认

--help, -h

打印用法说明

示例

将所有存储重置回干净的初始状态。

$ podman system reset
WARNING! This will remove:
        - all containers
        - all pods
        - all images
        - all networks
        - all build cache
        - all machines
        - all volumes
        - the graphRoot directory: /var/lib/containers/storage
        - the runRoot directory: /run/containers/storage
Are you sure you want to continue? [y/N] y

强制将所有存储重置回干净的初始状态。

$ podman system reset --force

将无根用户从 VFS 驱动程序切换到使用 fuse-overlayfs 的 overlay

如果用户在未安装 fuse-overlayfs 程序的情况下运行无根容器,podman 默认使用其主目录中的 vfs 存储。如果他们想切换到使用 fuse-overlay,他们必须安装 fuse-overlayfs 软件包。用户需要重置存储以默认使用 overlayfs。首先以用户身份执行 podman system reset 以删除 VFS 存储。现在用户可以编辑 /etc/containers/storage.conf 以进行任何必要的更改。如果系统的默认设置已经是 overlay,则无需更改即可切换到 fuse-overlayfs。Podman 在 overlay 驱动程序中设置时,会查找 fuse-overlayfs 的存在以使用它,只有当程序不存在时才回退到 vfs。用户可以运行 podman info 以确保 Podman 正在使用 fuse-overlayfs 和 overlay 驱动程序。

另请参阅

podman(1)podman-system(1)fuse-overlayfs(1)containers-storage.conf(5)

历史

2019 年 11 月,最初由 Dan Walsh (dwalsh at redhat dot com) 编写