Skip to content

Feature Request: prune persistent volumes #26807

@tobwen

Description

@tobwen

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

  1. Add a --persistent flag to podman volume create:

    podman volume create --persistent my_important_data
  2. 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
  3. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions