Skip to content

snapshot create: ext4 lost+found is root-only 0700 → noisy find Permission denied on volume walks #177

Closed

Description

@scttfrdmn

Context

Surfaced validating nf-spawn#55 (zero-copy DBs on read-only EBS volumes). When spawn snapshot create builds an ext4 image from a directory or tar (hcsshim tar2ext4), the lost+found directory is created root-owned, mode 0700 (hardcoded in hcsshim/ext4/internal/compactext4/compact.go).

A tool that walks the mounted volume as a non-root user emits a harmless but noisy stderr line, e.g. MetaPhlAn:

find: 'metaphlan/lost+found': Permission denied

find still resolves the real content, so it's cosmetic — but it's confusing in logs and looks like a failure.

Fix

pkg/aws/snapshot_image.go: prepend a lost+found/ directory tar entry at mode 0755 to the tar stream before tar2ext4.Convert. The writer re-applies the mode when a lost+found directory entry repeats (confirmed by hcsshim's own compact_test.go), so this overrides the default without re-muxing the (possibly very large) source.

Implemented in the linked PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions