Pcornel
Containers

Container Storage

Cheat sheet · https://pcornel.dk/topic.php?topic=6077

Back to the Topic

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 codes
  • docker logs <c> — container output
  • docker 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

BoundaryInspectHealthy interpretationDo not infer
IntentBind mountsIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeNamed volumes / tmpfsOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective statePersistence boundariesIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeUID/GID and permission behaviorThe original bounded check succeeds in the same time windowProduction 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

Confirmation

Confirm action

Continue?