Container Storage
Cheat sheet · https://pcornel.dk/topic.php?topic=6077
Answer
Container storage: the writable container layer (lost on removal), volumes managed by the runtime, bind mounts of host paths, and in Kubernetes PersistentVolumes provided by CSI drivers.
Remember
Put all state on volumes. Bind mounts need matching UID/GID and SELinux labels (:Z). Back up volumes, not containers.
First checks
docker ps -a— containers and exit codesdocker logs <c>— container outputdocker inspect <c>— config, mounts, network, state
Verify in this order
volume/PV → mounted into container → app writes → survives container restarts
Where it usually breaks
Common failures are writing important data into the ephemeral writable layer, host-path permission mismatches, SELinux/AppArmor labeling issues, mounting over image content, backing up live inconsistent data, or assuming a volume name proves the underlying storage is healthy.
Container Storage verification boundary matrix
| Boundary | Inspect | Healthy interpretation | Do not infer |
|---|---|---|---|
| Intent | Bind mounts | Intended object/scope is explicit and versioned where relevant | Intent is already effective |
| Owning runtime/control plane | Named volumes / tmpfs | Owner accepts and reports the expected object state | Downstream dependencies are healthy |
| Effective state | Persistence boundaries | Independent read-back matches the intended state | Every client sees the same result |
| Consumer outcome | UID/GID and permission behavior | The original bounded check succeeds in the same time window | Production correctness outside this scope |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6077