Cri File System Tools Link May 2026
# Find snapshot path SNAPSHOT_PATH=$(crictl inspect <container> | jq -r '.info.rootDir') cp -al $SNAPSHOT_PATH /tmp/clone-rootfs Now modify /tmp/clone-rootfs without affecting the original (COW at file level)
crictl images # Lists images with their IDs and sizes crictl inspect <container-id> # Shows detailed mount points and layer paths crictl imagefsinfo # Reports filesystem usage for image storage The inspect command reveals the rootfs path—a symbolic link that points to the container’s writable layer. For example: cri file system tools link
# Get container PID crictl inspect <container> | grep pid nsenter -t <pid> -m bash Inside, check for broken symlinks find / -type l -xtype l 2>/dev/null The CRI is a Kubernetes API that kubelet
This article explores the relationship between CRI-compliant runtimes (containerd and CRI-O), the filesystem tools that manipulate container storage, and how the humble link (both symbolic and hard) functions as the architectural glue holding container layers together. Before diving into tools and links, we must establish a baseline. The CRI is a Kubernetes API that kubelet uses to communicate with container runtimes. It abstracts the runtime implementation, allowing Kubernetes to work with Docker (via dockershim, now deprecated), containerd, CRI-O, and others. Conclusion: The Link is the Lost Art of
Also, the new feature (v1.25+) uses hard links to preserve container state before migration. Conclusion: The Link is the Lost Art of Container Storage The CRI file system tools — crictl , ctr , crio-status —give you x-ray vision into how Kubernetes manages storage. But without understanding the link (whether symbolic, hard, or the conceptual parent pointer between layers), you are blind to half of the system.
/var/lib/containers/storage/overlay/<layer-id>/merged -> /var/lib/containers/storage/overlay/<layer-id>/../<parent-id>/merged Scenario 1: "No such file or directory" inside a container Even though the file exists in the image, the container cannot see it. This is often due to a broken symbolic link in a lower layer .
systemctl stop containerd mv /var/lib/containerd /mnt/new-disk/containerd ln -s /mnt/new-disk/containerd /var/lib/containerd systemctl start containerd Ensure the link is absolute and permissions (owner root:root , mode 0755 ) match. Advanced: Manipulating CRI Snapshots with Hard Links for Fast Cloning Hard links are not just for files—they can be used at the directory level (via cp -al ) to create instant clones of container root filesystems without copying data. This is a powerful technique when you need multiple copies of a snapshot for testing.