Problem description
When creating files within the ECS Linux system, there is a lack of space hint like the following:
No space left on device …
Cause of the problem
Possible causes of this problem include:
- Disk partition space usage reaches 100%.
- The disk partition Inode utilization reaches 100%.
- Zombie Files: Deleted files are not freed due to a handle being occupied without releasing the corresponding space.
Treatment methods
To resolve this issue, we recommend that you handle the following:
- Full partition capacity
- Inode capacity Full
- Modify Inode Number
- Zombie File Analysis Delete
Full partition capacity
Login to SSH, use df-h to view usage, mounted on refers to the mounted directory:
Loop to execute the following instructions to see which directory is large, enter the directory:
cd /
du -sh *
Until the most accurate file or directory is found, then the relevant files or directories are deleted, in combination with business conditions. or buy larger data disks to share the processing.
Inode capacity Full
Log in to SSH and run the following command to analyze how many files are under each directory under the root directory:
for i in /*; do echo $i; find $i | wc -l; done
Then, step into the Inode occupies the highest directory, continue to execute the above instructions, gradually locate the file or directory that occupies too much space, and finally make corresponding cleanup.
Modify Inode Number
The inode node of ECS Linux records important information such as file type, size, permissions, owner, number of file connections, creation time and update time, and a more important content is a pointer to the data block. The general situation does not require special configuration, if the storage file a lot, need to configure. Sometimes there is a surplus of disk space but cannot store files, possibly due to inode exhaustion. df-i can query the usage of inode:
You can see the following steps to adjust the number of Inode nodes:
Note:The inode adjustment requires reformatting the disk, make sure that the data has been backed up effectively before doing the following.
1, uninstall the system files. Like what:
umount /home
2. Re-establish the file system and specify the number of Inode nodes:
mkfs.ext3 /dev/xvdb -N 1638400
3. Modify the Fstab file:
vim /etc/fstab
4. View the number of Inode nodes after modification:
dumpe2fs -h /dev/xvdb | grep node
Zombie File Analysis Delete
If there is no problem with the disk and the inode, you need to see if there is a zombie file that has not been cleared handle. These files have actually been deleted, but a service program is using these files, causing the files to remain occupied, unable to free up disk space, and using the following command to view the dead file occupancy:
lsof |grep delete | more
If these files are too large, it can take up a lot of disk space. You can clear the zombie file by releasing the handle as follows:
- Restart the server.
- Gracefully stop or kill service processes that occupy these files.
Troubleshooting Cloud Server ECS Linux disk space full (including Innode full)