A disk write error on Linux means a program could not save data to its intended destination, but it does not automatically mean the drive is broken. The cause may be a full filesystem, insufficient permissions, a read-only mount, a connection problem, filesystem damage, or failing storage; the exact error message and system logs help distinguish them.
What a Disk Write Error Means
Linux programs request that the operating system write data to a file or device. If that request cannot be completed, the program receives an error and may display a message such as ‘No space left on device’, ‘Read-only file system’, ‘Permission denied’, or ‘Input/output error’. These messages point to different problems, so treating every write failure as a bad hard drive can lead to unnecessary repairs—or missed data loss.
The error can occur at several layers. An application might be unable to write to a particular file, the filesystem might reject a change, or the kernel might be unable to communicate reliably with the storage device. The destination might also be remote, such as a network share, rather than a local disk. A failed save therefore identifies a problem with the write operation, not necessarily the physical disk itself.
How Linux Writes Data
When an application saves a file, it usually asks the kernel to write data through the filesystem. The filesystem organizes files and tracks which blocks of storage they occupy. The kernel then passes the work to the relevant device driver, which communicates with an SSD, hard drive, USB device, or network storage service. A failure at any point can prevent the application from completing the save.
Some writes are buffered: an application may appear to finish saving before every bit of data has reached the physical device. Later, when Linux flushes that data, a device or connection problem can still be reported. This is one reason an error may appear after an application has been open for a while, or why a device that was unplugged without safe removal may show problems on the next use.
Linux also reports specific error conditions. ‘ENOSPC’ means there is no space available for the requested operation, while ‘EACCES’ indicates a permissions problem. ‘EROFS’ means the filesystem is read-only, and ‘EIO’ indicates an input/output failure reported while accessing storage. Applications do not always display these technical names, but the wording they do show is often a useful clue.
Common Causes
- Full disk or partition: The filesystem holding the destination has no available blocks. A separate home, boot, or data partition can fill even when the main system partition has room.
- Exhausted inodes: A filesystem can run out of file entries while still showing free space. This can happen when a program creates a very large number of small files, such as caches or temporary files.
- Permissions or ownership: The current user may not have permission to write to the directory or file. A file owned by another account, a protected system directory, or a read-only permission setting can cause this.
- Read-only filesystem: Linux may mount a filesystem as read-only by design, or remount it read-only after detecting errors to limit further damage.
- Device or connection trouble: A loose cable, unreliable USB hub, insufficient power, failing storage, or interrupted network connection can break writes.
- Filesystem errors: An unclean shutdown, failing device, or other fault may leave filesystem structures inconsistent and prevent safe changes.
- Limits and application behavior: A user or project quota may be reached even when the filesystem has free space. An application may also be trying to write to the wrong path or use more temporary space than expected.
Not every error is about total storage capacity. For example, a download can fail because the destination directory is not writable even though the disk has terabytes free. Similarly, deleting a large file might not immediately free space if a running process still has that file open.
Start With the Exact Error and Destination
Before changing settings or running repair tools, note the full message, the program that produced it, and the path being written. A failure when saving to a USB drive suggests different checks from one that occurs while installing a package or writing to a shared server. If a save failed, do not assume the file is intact: check whether it is missing, incomplete, or still open in the application.
Identify which filesystem contains the destination. For a path such as /home/sam/Downloads/file.zip, inspect the filesystem mounted at /home or the nearest parent directory. Commands such as findmnt /home/sam/Downloads can show the relevant mount. This matters because checking free space on the root filesystem alone will not reveal a full separate data partition.
Check Space, Inodes, and Permissions
Two useful first checks are df -h for space and df -i for inodes. The -h option makes sizes easier to read; the inode report shows whether file entries are exhausted. To check a particular destination, give the path to the command, for example df -h /home/sam/Downloads. If the filesystem has free capacity but the error says no space is available, check inodes and any applicable quota.
For a permissions error, inspect the directory and file with ls -ld /path/to/directory and ls -l /path/to/file. The user running the application must have suitable permissions on the directory and, when replacing an existing file, often on the file itself. Avoid using sudo as a general workaround: it can create root-owned files that the normal user cannot later edit, and it does not fix a full disk or failing device.
If space is genuinely low, remove or move files you recognize and no longer need. Check large logs, downloads, backups, and caches rather than deleting unfamiliar system files. Emptying a desktop trash folder may be necessary because trashed files still occupy space. On a shared or managed machine, quotas may require an administrator to increase a limit or identify the account consuming it.
Check Mounts, Logs, and Device Health
Use findmnt or mount to see whether the destination is mounted read-only. For a removable drive, confirm that it is mounted at the expected location and that the application is writing to that mount rather than to an empty directory underneath it. A mount option or system policy may intentionally prevent writes.
Kernel messages can reveal storage resets, filesystem complaints, or device communication errors. Run journalctl -k -b to review kernel messages from the current boot; on some systems, dmesg is also available. Look for entries around the time of the failure, especially messages naming the device or filesystem. A log entry is evidence to investigate, not proof by itself that a drive has failed.
For supported drives, SMART health information can provide additional clues. The smartctl tool from the smartmontools package can read it, but the command and available data depend on the drive and its connection; some USB adapters do not pass SMART information through. A health report that looks normal does not guarantee that a device or cable is reliable. If repeated I/O errors occur, prioritize copying important data before running lengthy tests.
Safe Troubleshooting and Repair
- Protect important files first. If the device is producing repeated I/O errors, disconnects, or unusual noises, reduce unnecessary activity and copy the most valuable data to another device. Repeated retries can add stress to failing hardware.
- Check simple causes. Confirm the path, free blocks, inodes, permissions, quota, and mount status. For removable storage, reseat the cable and avoid an unpowered or unreliable hub.
- Read system logs. Match kernel messages to the time of the failed write and note the device name. This can help distinguish a device-level problem from an application or permissions issue.
- Unmount before filesystem repair. Filesystem-checking tools such as
fsckare generally meant to operate on an unmounted filesystem, or on a filesystem handled through an appropriate recovery environment. Do not run repair commands on a mounted filesystem unless the tool and filesystem documentation explicitly say it is safe. - Escalate persistent hardware errors. If errors return after checking connections or repairing a filesystem, replace or professionally assess the suspect device. Keep a separate backup; a repair is not a backup.
Do not format a drive simply because one write failed. Formatting can erase data and does not address a loose cable, bad power supply, quota limit, or failing device. Likewise, forcing a read-only filesystem back into read-write mode can make damage worse if Linux remounted it read-only to protect data.
Removable and Network Storage
USB flash drives and external disks add connection and power variables. A write can fail if a cable is loose, a hub cannot provide enough power, or the device is removed before pending writes finish. Use the desktop’s eject option or an appropriate unmount command, and wait for confirmation before disconnecting. If the device works on one port but not another, that points toward a connection or power issue, though it does not rule out a damaged drive.
Network shares and cloud-synced folders can also report write failures. The server may be unreachable, the login may have expired, the share may be read-only, or the account may lack space or permission. A local file manager can make a remote path look like an ordinary folder, but the write still depends on the network and remote service. Check the connection and server-side status as well as the local filesystem.
When a Write Error Signals a Failing Drive
One isolated error caused by a full partition or incorrect permission is not evidence of hardware failure. Concern rises when I/O errors recur across different files, the device repeatedly disappears, the system freezes during storage access, or kernel logs report resets and read/write failures. Unusual clicking or grinding from a mechanical hard drive is another warning sign; shut it down if appropriate and prioritize data recovery rather than experimenting.
SSDs do not make the same mechanical noises, and their failure can be sudden. Neither an apparently normal SMART report nor a successful filesystem check guarantees future reliability. If the data matters, maintain a separate backup before a problem appears. When a device is unstable and the data is irreplaceable, professional recovery may be safer than repeated repair attempts.
Frequently Asked Questions
Does a Linux disk write error mean my hard drive is broken?
No. It can result from full storage, exhausted inodes, permissions, quotas, a read-only mount, or an interrupted connection. Repeated I/O errors and device dropouts are more concerning and justify checking logs and backing up data.
Why does Linux say ‘No space left on device’ when space is available?
The destination may be on a different full partition, the filesystem may have run out of inodes, or a quota may limit your account. Check the exact destination with df -h /path and df -i /path, then check quotas if applicable.
Can I fix a read-only filesystem by remounting it as writable?
Sometimes a mount is intentionally read-only, but Linux may also switch it to read-only after detecting errors. Find out why it is read-only before changing the mount. If logs show filesystem or device errors, back up data and use the appropriate unmounted repair procedure instead of forcing writes.
Is it safe to run fsck while Linux is running?
Do not run a filesystem repair on a mounted filesystem unless the particular tool and filesystem explicitly support that operation. For a system partition, booting from recovery media may be necessary so the filesystem can be unmounted first.
What should I do if an external drive reports an I/O error?
Stop repeated write attempts, check the cable and power, and copy important readable files to another device. Review kernel logs for device errors. If the drive keeps disconnecting or reporting failures, avoid formatting it and consider professional recovery for valuable data.