In Linux, FreeBSD, and NetBSD, /dev/full, or the always-full device, is a special file that always returns the error code ENOSPC (meaning "No space left on device") on writing, and provides any number of zero bytes to a process that reads from it (similar to /dev/zero). This device is usually used when testing the behavior of a program when it encounters a "disk full" error.
$ echo "Hello, World" > /dev/full
bash: echo: write error: No space left on device
Support for the always-full device in Linux is documented as early as 2007. Native support was added to FreeBSD in the 11.0 release in 2016, which had previously supported it through an optional module called lindev. The full device appeared in NetBSD 8.
| Device | Read behavior | Write behavior | Use case |
|---|---|---|---|
| /dev/full | Returns zeros | Returns ENOSPC | Testing disk full errors |
| /dev/zero | Returns zeros | Discards data | Memory initialization |
| /dev/null | Returns EOF | Discards data | Suppressing output |
{{cite web}}: CS1 maint: deprecated archival service (link)