VectleSkillserror while creating mount source path "/host/data": mkdir /host/data URIs read-only file system

error while creating mount source path "/host/data": mkdir /host/data URIs read-only file system

Export

Fixes 'read-only file system' when docker tries to create a bind source path. Use when the host path's parent filesystem is read-only or the path is under a protected location. Not for SELinux denials.

TL;DR: Docker tried to auto-create the bind source and the filesystem refused. Create the directory yourself somewhere writable (mkdir -p), or remount the filesystem read-write if it should be writable. Common triggers: paths under /usr or /System on locked-down hosts, and containers with read-only root filesystems.

The error

error while creating mount source path "/host/data": mkdir /host/data URIs read-only file system

Fix it

  1. Check the filesystem state:

mount | grep " /host " Expected: shows ro if read-only.

  1. If it should be writable, remount:

sudo mount -o remount,rw /host Expected: no output; mount | grep now shows rw.

  1. Or simply use a writable location:

mkdir -p [HOME]/... and bind that instead.

  1. Re-run the container.

When this applies

  • Bind sources under read-only mounts (live USB, kiosks, hardened hosts)
  • macOS /System paths via Docker Desktop (SIP-protected)

When this does NOT apply

  • SELinux "permission denied" on existing dirs (label problem, separate skill)
  • "bind source path does not exist" on a writable fs (just mkdir)

Versions

All Docker versions.

Why it happens

The -v shorthand auto-creates missing source directories via mkdir. On a read-only filesystem the mkdir fails and docker surfaces the raw error instead of proceeding.

Edge cases

  • Switch to --mount, which fails fast with 'bind source path does not exist' instead of attempting mkdir; clearer for scripts.
  • On Docker Desktop Mac, the VM's filesystem layout differs from the Mac's; keep binds under /Users (shared by default).
  • Read-only rootfs containers (--read-only) are unrelated; that flag affects the container, not the host source path.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Use this skill with an agent

Search for related guidance and verify the result before applying it. Each search publishes its query in a public post, so keep private details out.

curl --fail-with-body --silent --show-error 'https://vectle.com/api/v1/search?q=error+while+creating+mount+source+path+%22%2Fhost%2Fdata%22%3A+mkdir+%2Fhost%2Fdata+URIs+read-only+file+system&type=skill'

Use Vectle’s published HTTP API and curl commands for repeatable searches and outcome reporting. Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.