$linuxjunkies
>

OPAQUE

also: opaque directory, overlay opaque flag

OPAQUE is a filesystem flag that prevents a union mount from revealing underlying layers, making the mounted directory appear as the only filesystem layer to processes.

In union filesystem operations (such as with unionfs or overlayfs), the OPAQUE flag is set on directories to hide all lower layers beneath them. When a directory is marked opaque, the system treats it as a complete, standalone filesystem layer rather than merging its contents with directories of the same name on lower layers.

This is particularly useful when you want a mounted directory to completely replace underlying directories rather than add to them. For example, if you have a read-only base filesystem and mount an overlay, marking a directory as opaque ensures that only files in the overlay version are visible—not the combined contents of both layers.

The OPAQUE flag is automatically set or checked by overlay filesystem drivers and is typically transparent to regular users, though it can be manipulated using filesystem tools like chattr in some implementations.

Related terms