Site icon EfmSoft

What does Windows error code 1142 (ERROR_TOO_MANY_LINKS) mean?

 
Previous Next
ERROR_SET_POWER_STATE_FAILED ERROR_OLD_WIN_VERSION

ERROR_TOO_MANY_LINKS

An attempt was made to create more links on a file than the file system supports.

ERROR_TOO_MANY_LINKS is Win32 error 1142 (0x476). It is returned when creating another hard link would exceed the link-count limit for the target file or filesystem. A hard link is another directory entry for the same file data on the same volume; it is not a shortcut, symbolic link, or junction.

Where the limit is reached

Microsoft documents a maximum of 1023 hard links per file for CreateHardLink on NTFS. Other filesystems or layers can impose different limits, so log the actual volume filesystem and API instead of hard-coding one assumption for every target.

Evidence to collect

Use file identity rather than pathname alone. Several paths can reference the same file record, and deleting one name does not remove the underlying file while other hard links remain.

Handling the failure

Do not automatically delete an arbitrary existing link to make room. Each name may be part of a package, snapshot, or backup contract. Decide whether the new name is required, whether an old name is obsolete, or whether the object should be copied as an independent file.

A restore tool should preserve semantics where possible and clearly report degradation when it must replace a hard link with a separate copy. That fallback changes space usage and future update behavior, so it should not be silent.

Developer recommendations

Hard links can only reference files on the same volume. A cross-volume design must copy data or use a different indirection mechanism; changing paths does not bypass that rule.

Related errors

ERROR_ALREADY_EXISTS means the requested directory entry already exists. ERROR_NOT_SAME_DEVICE can appear for operations that cross volumes. Error 1142 specifically says the existing file has reached the supported number of hard-link names.

Example

A package cache links one common payload into thousands of version directories. After the 1023rd NTFS link, the next CreateHardLink call returns 1142. The durable design is to shard payload files or use a catalog plus fewer links, not to delete names belonging to installed versions.

References


Looking for a different code? Search another status or error code.

Exit mobile version