Linux, the renowned open-source operating system, serves as the backbone for a wide range of applications and platforms. From the smallest Raspberry Pi systems to the most massive supercomputers, Linux is omnipresent. But as with all operating systems, encountering errors is part and parcel of the experience. What sets Linux apart, however, is the transparency it provides with its error codes. Instead of vague error messages, Linux provides specific codes that can help diagnose issues more precisely.
Table of Contents
Examples of Linux Error Codes
Linux error codes aren’t just arbitrary numbers; they have significance. Each code corresponds to a specific type of error, which makes troubleshooting a more structured process. Whether you’re a newbie just dabbling in Linux or an expert managing servers, understanding these codes is invaluable.
- Errno 1: EPERM: EPERM means that the operation isn’t permitted. This typically occurs when a user tries to perform an action without the required permissions. For instance, a regular user attempting to modify system files might face this error.
- Errno 2: ENOENT: It signifies that a particular file or directory was not found. Whether you’re trying to access a file, execute a script, or launch an application, if the system can’t locate it, you’ll encounter this error.
- Errno 4: EINTR: EINTR refers to the interruption of a system call. An operation was interrupted by a signal before it could be completed. This might not always be an issue, as some system calls might resume after a signal interruption.
- Errno 9: EBADF: EBADF signifies an invalid file descriptor. If you attempt to perform an operation (like read or write) on an invalid or closed file descriptor, this error will pop up.
- Errno 11: EAGAIN (or EWOULDBLOCK): This error indicates that an operation would block the ongoing process. For non-blocking operations, encountering EAGAIN or EWOULDBLOCK suggests that the operation should be tried again later.
- Errno 13: EACCES: EACCES is the error code when permission to access a file or directory is denied. This could happen if you’re trying to read a file without read permissions or write to a file without write permissions.
- Errno 14: EFAULT: EFAULT points to a bad address. Basically, this error tells you that the system encountered a bad memory address during its operations.
- Errno 22: EINVAL: EINVAL implies an invalid argument. This means one of the parameters in a system call is not valid, which can be due to a range of reasons, like an out-of-range value.
- Errno 28: ENOSPC: This error code stands for “No Space Left on Device.” It’s triggered when there’s insufficient space on a storage medium, often when trying to write to a full disk.
- Errno 31: EMLINK: This error is about reaching the maximum number of links to a single file. When the filesystem can’t add another link because the limit is reached, EMLINK is raised.
- Errno 32: EPIPE: This is the “Broken Pipe” error. If one end of a pipe is closed, and the other end still attempts to write to it, you’ll encounter EPIPE.
List of All Linux Error Codes
hex | symbol | description |
---|---|---|
0x01 | EPERM | Operation not permitted |
0x02 | ENOENT | No such file or directory |
0x03 | ESRCH | No such process |
0x04 | EINTR | Interrupted system call |
0x05 | EIO | Input/output error |
0x06 | ENXIO | No such device or address |
0x07 | E2BIG | Argument list is too long |
0x08 | ENOEXEC | Exec format error |
0x09 | EBADF | Bad file descriptor |
0x0a | ECHILD | No child processes |
0x0b | EAGAIN | Resource temporarily unavailable |
0x0b | EWOULDBLOCK | Resource temporarily unavailable |
0x0c | ENOMEM | Cannot allocate memory |
0x0d | EACCES | Permission denied |
0x0e | EFAULT | Bad address |
0x0f | ENOTBLK | Block device required |
0x10 | EBUSY | Device or resource busy |
0x11 | EEXIST | File exists |
0x12 | EXDEV | Invalid cross-device link |
0x13 | ENODEV | No such device |
0x14 | ENOTDIR | Not a directory |
0x15 | EISDIR | Is a directory |
0x16 | EINVAL | Invalid argument |
0x17 | ENFILE | Too many open files in the system |
0x18 | EMFILE | Too many open files |
0x19 | ENOTTY | Inappropriate ioctl for device |
0x1a | ETXTBSY | Text file busy |
0x1b | EFBIG | File too large |
0x1c | ENOSPC | No space left on the device |
0x1d | ESPIPE | Illegal seek |
0x1e | EROFS | Read-only file system |
0x1f | EMLINK | Too many links |
0x20 | EPIPE | Broken pipe |
0x21 | EDOM | Numerical argument out of domain |
0x22 | ERANGE | Numerical result out of range |
0x23 | EDEADLK | Resource deadlock avoided |
0x23 | EDEADLOCK | Resource deadlock avoided |
0x24 | ENAMETOOLONG | File name is too long |
0x25 | ENOLCK | No locks available |
0x26 | ENOSYS | Function not implemented |
0x27 | ENOTEMPTY | Directory not empty |
0x28 | ELOOP | Too many levels of symbolic links |
0x29 | ||
0x2a | ENOMSG | No message of the desired type |
0x2b | EIDRM | Identifier removed |
0x2c | ECHRNG | Channel number out of range |
0x2d | EL2NSYNC | Level 2 not synchronized |
0x2e | EL3HLT | Level 3 halted |
0x2f | EL3RST | Level 3 reset |
0x30 | ELNRNG | Link number out of range |
0x31 | EUNATCH | The protocol driver not attached |
0x32 | ENOCSI | No CSI structure is available |
0x33 | EL2HLT | Level 2 halted |
0x34 | EBADE | Invalid exchange |
0x35 | EBADR | Invalid request descriptor |
0x36 | EXFULL | Exchange full |
0x37 | ENOANO | No anode |
0x38 | EBADRQC | Invalid request code |
0x39 | EBADSLT | Invalid slot |
0x3a | ||
0x3b | EBFONT | Bad font file format |
0x3c | ENOSTR | Device is not a stream |
0x3d | ENODATA | No data available |
0x3e | ETIME | Timer expired |
0x3f | ENOSR | Out of streams resources |
0x40 | ENONET | The machine is not on the network |
0x41 | ENOPKG | Package not installed |
0x42 | EREMOTE | Object is remote |
0x43 | ENOLINK | The link has been severed |
0x44 | EADV | Advertise error |
0x45 | ESRMNT | Srmount error |
0x46 | ECOMM | Communication error on send |
0x47 | EPROTO | Protocol error |
0x48 | EMULTIHOP | Multihop attempted |
0x49 | EDOTDOT | RFS specific error |
0x4a | EBADMSG | Bad message |
0x4b | EOVERFLOW | Value too large for defined data type |
0x4c | ENOTUNIQ | Name not unique on the network |
0x4d | EBADFD | File descriptor in a bad state |
0x4e | EREMCHG | Remote address changed |
0x4f | ELIBACC | Can not access a needed shared library |
0x50 | ELIBBAD | Accessing a corrupted shared library |
0x51 | ELIBSCN | .lib section in a.out corrupted |
0x52 | ELIBMAX | Attempting to link in too many shared libraries |
0x53 | ELIBEXEC | Cannot exec a shared library directly |
0x54 | EILSEQ | Invalid or incomplete multibyte or wide-character |
0x55 | ERESTART | Interrupted system calls should be restarted |
0x56 | ESTRPIPE | Streams pipe error |
0x57 | EUSERS | Too many users |
0x58 | ENOTSOCK | Socket operation on non-socket |
0x59 | EDESTADDRREQ | Destination address required |
0x5a | EMSGSIZE | Message too long |
0x5b | EPROTOTYPE | Protocol wrong type for socket |
0x5c | ENOPROTOOPT | Protocol not available |
0x5d | EPROTONOSUPPORT | Protocol not supported |
0x5e | ESOCKTNOSUPPORT | Socket type not supported |
0x5f | EOPNOTSUPP | Operation not supported |
0x5f | ENOTSUP | Operation not supported |
0x60 | EPFNOSUPPORT | Protocol family not supported |
0x61 | EAFNOSUPPORT | Address family not supported by protocol |
0x62 | EADDRINUSE | Address already in use |
0x63 | EADDRNOTAVAIL | Cannot assign requested address |
0x64 | ENETDOWN | Network is down |
0x65 | ENETUNREACH | Network is unreachable |
0x66 | ENETRESET | The network dropped connection on reset |
0x67 | ECONNABORTED | Software caused connection abort |
0x68 | ECONNRESET | Connection reset by peer |
0x69 | ENOBUFS | No buffer space is available |
0x6a | EISCONN | The transport endpoint is already connected |
0x6b | ENOTCONN | The transport endpoint is not connected |
0x6c | ESHUTDOWN | Cannot send after transport endpoint shutdown |
0x6d | ETOOMANYREFS | Too many references: cannot splice |
0x6e | ETIMEDOUT | Connection timed out |
0x6f | ECONNREFUSED | Connection refused |
0x70 | EHOSTDOWN | Host is down |
0x71 | EHOSTUNREACH | No route to host |
0x72 | EALREADY | Operation already in progress |
0x73 | EINPROGRESS | Operation now in progress |
0x74 | ESTALE | Stale file handle |
0x75 | EUCLEAN | Structure needs cleaning |
0x76 | ENOTNAM | Not a XENIX-named type file |
0x77 | ENAVAIL | No XENIX semaphores available |
0x78 | EISNAM | Is a named type file |
0x79 | EREMOTEIO | Remote I/O error |
0x7a | EDQUOT | Disk quota exceeded |
0x7b | ENOMEDIUM | No medium found |
0x7c | EMEDIUMTYPE | Wrong medium type |
0x7d | ECANCELED | Operation canceled |
0x7e | ENOKEY | The required key is not available |
0x7f | EKEYEXPIRED | Key has expired |
0x80 | EKEYREVOKED | The key has been revoked |
0x81 | EKEYREJECTED | The key was rejected by the service |
0x82 | EOWNERDEAD | Owner died |
0x83 | ENOTRECOVERABLE | State not recoverable |
0x84 | ERFKILL | Operation is not possible due to RF-kill |
0x85 | EHWPOISON | The memory page has a hardware error |