Hadoop stores HDFS replicas and YARN working files on local disks, but each component accounts for space differently. Troubleshooting a Hadoop disk-full error means finding the filesystem that rejected the write and restoring enough capacity for that operation to succeed.
HDFS can reject a new block while a disk still has some free space because block allocation also needs room for reserved capacity. Cluster-wide free space can hide an individual full DataNode, while a YARN health report refers to the NodeManager's local or log directories rather than an HDFS directory.
Reclaiming obsolete HDFS data is appropriate when DataNode storage is full and its owner has approved deletion. An administrator needs access to the cluster report and the affected host, while deletion needs permission on the HDFS parent directory; data still required for recovery needs a restorable copy outside the full cluster.
Steps to troubleshoot Hadoop disk full errors:
- Identify the failing component from the Hadoop error.
put: File /data/events/incoming/events.csv._COPYING_ could only be written to 0 of the 1 minReplication nodes. There are 2 datanode(s) running and 2 node(s) are excluded in this operation.
This HDFS upload error can also mean unavailable DataNodes or connectivity problems; it does not prove a full disk by itself. For a YARN error naming a local or log directory, the relevant filesystem is on that NodeManager host. Deleting HDFS data helps only if it occupies that same filesystem, and active YARN container files must remain intact.
- Inspect the remaining capacity of each DataNode in the HDFS report.
$ hdfs dfsadmin -report Configured Capacity: 536870912 (512 MB) Present Capacity: 534810000 (510.03 MB) DFS Remaining: 10641408 (10.15 MB) DFS Used: 524168592 (499.89 MB) DFS Used%: 98.01% ##### snipped #####
The per-node entries below the totals identify which hosts lack space. High Non DFS Used points to local files outside HDFS. A QuotaExceededException instead points to a directory quota, which can block a write even when disks have room.
- Locate the configured HDFS data volumes on the affected DataNode.
$ hdfs getconf -confKey dfs.datanode.data.dir file:///data/hadoop/hdfs/data
getconf reads the local configuration, so it needs the same HADOOP_CONF_DIR as the running DataNode. Multiple configured paths can reside on different filesystems.
- Check filesystem usage for the affected DataNode's data path.
$ df -h /data/hadoop/hdfs/data Filesystem Size Used Avail Use% Mounted on tmpfs 256M 251M 5.1M 99% /data/hadoop/hdfs/data
The filesystem and capacity vary by host. If byte usage is low despite a local No space left on device error, df -i /data/hadoop/hdfs/data can reveal exhausted inodes. HDFS block files must never be deleted directly from this directory.
- List the space consumed by the application's obsolete HDFS data.
$ hdfs dfs -du -h /data/events/checkpoints 248 M 496 M /data/events/checkpoints/old-run-2026-05
The first column is logical size; the second includes replicas. The HDFS path is separate from the local DataNode path, even when both start with /data. The directory shown is a retired run, not a live application's recovery checkpoint.
- Delete only the HDFS directory approved for permanent removal.
This recursively deletes the selected directory and bypasses Trash, so HDFS cannot undo it. The path must match the owner's approved retired data, with any required backup already checked. Moving data to Trash would retain its blocks; if permanent deletion is not permitted, additional storage is needed instead. Snapshots can also retain blocks after deletion.
$ hdfs dfs -rm -r -skipTrash /data/events/checkpoints/old-run-2026-05 Deleted /data/events/checkpoints/old-run-2026-05
- Confirm that free space has returned on the affected DataNode.
$ df -h /data/hadoop/hdfs/data Filesystem Size Used Avail Use% Mounted on tmpfs 256M 20K 256M 1% /data/hadoop/hdfs/data
HDFS block deletion is asynchronous, so capacity may take time to return. An HDFS restart is unnecessary for routine reclamation. If space remains unavailable, retained snapshots, other writers, or an uneven distribution of blocks may explain it.
- Retry the HDFS upload that failed for lack of space.
$ hdfs dfs -put events.csv /data/events/incoming/events.csv
This uploads an existing local CSV into an existing HDFS directory and prints nothing on success. The file and destination must match the original failed operation; omitting -f protects an existing destination from replacement.
- Read the uploaded file from HDFS to confirm that the write completed.
$ hdfs dfs -cat /data/events/incoming/events.csv event_id,event_type 1,page_view