-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed as duplicate of#23217
Description
Summary
Add support for "persistent" volumes that are excluded from podman system prune
by default, requiring explicit confirmation or a special flag to delete them.
Description
Currently, all volumes are treated equally by podman system prune
, which can accidentally delete important volumes containing valuable data. Users need a way to protect certain volumes from accidental deletion while maintaining the ability to clean up temporary volumes.
Proposed Solution
-
Add a
--persistent
flag topodman volume create
:podman volume create --persistent my_important_data
-
Modify prune behavior:
- Persistent volumes are skipped by default in
podman system prune
- Add
--include-persistent
flag to override this protection - Alternative: Interactive confirmation when persistent volumes exist
- Persistent volumes are skipped by default in
-
Add visibility features:
podman volume inspect # shows "Persistent": true/false podman volume ls # adds PERSISTENT column
Use Cases
- Database volumes that should never be accidentally purged
- Configuration volumes containing important state
- Development environments mixing long-lived and temporary volumes
Alternatives Considered
- Using labels (not respected by prune)
- Manual volume management (error-prone)
- External documentation/remembering (ineffective)
Additional Context
This would providing more granular control in what gets pruned. Backward compatibility would be maintained by treating existing volumes as non-persistent.
Metadata
Metadata
Assignees
Labels
No labels