3

I want to remove a snapshot from a node in our Kubernates cluster:

/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/NNNN

But I am unable to map this path to any snapshots as reported by ctr -n k8s.io snapshots list. I have tried the usage command, but the INODE does not seem to map to the NNNN entry in the snapshots directory, because the "usage" list is not a subset of the entries in the directory.

Is there a way to understand if snapshot/NNNN is in use?

Gunnar
  • 151
  • 2

1 Answers1

0

The mapping is stored in /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/metadata.db

This database file map between the SHA256 hash of the snapshot and the snapshot id (the 'nnnn' number used as a directory name). the database format is Bolt DB (the library used for read/write is bbolt).

I have written an open source project that, among other things, reads that database.

Tal Aloni
  • 191
  • 1
  • 2