You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
High instance load issue
Troubleshooting and solution for high disk load of ECS instance with Linux system
Copy page
Download PDF
Troubleshooting and solution for high disk load of ECS instance with Linux system
This topic describes how to troubleshoot and handle the No space left on device error that may occur due to high disk load (usage) when you create a file or application on a Linux instance.​
Procedure​
View details of current disk usage​
  1. Log in to the target instance. For operation details, refer to Logging in to Linux instances.​
  1. Execute the following command to view the current disk usage.​
  • ​
    df -h​
    ​
  • Sample output​
  • ​​​
  1. View disk usage details for each directory level by level.​
This topic starts from the root directory / as an example.​
  1. Execute the following command to enter the root directory.​
  • ​
    cd /​
    ​
  1. Execute the following command to view the folder in the current directory that uses the most disk space.​
  • ​
    du -sh *​
    ​
  • Sample output​
  • ​​​
  1. Execute the following command to enter the usr directory.​
In the example provided in this topic, the large file is in the usr directory. Replace it with the actual directory path.​
  • ​
    cd usr/​
    ​
  1. Execute the following command to view the folder in the current directory that occupies the most disk space.​
  • ​
    du -sh *​
    ​
  • Sample output​
  • ​​​
  1. Repeat steps c and d until you locate the file that uses a large amount of space. After this, confirm whether the target file is used by the system or for business purposes.​
  • File cleanup cannot be performed​
  • If the target large file is necessary for your business or system and cannot be cleaned up, you can upgrade your instance configuration, expand the volume capacity, or change the volume specification. This ensures that programs can run normally without being limited by the performance of the volume. For operation details, refer to Changing instance types, Expanding volumes, and Changing volume specifications.​
​
  • File cleanup can be performed​
  • If the target large file is not necessary, you can execute the following command to forcibly delete the file and free up disk space.​
warning​
  • Deletion is irreversible. Please proceed with caution.​
  • Replace /usr/local/test_large_file in the command with the actual path of the target file.​
  • ​
    rm -rf /usr/local/test_large_file​
    ​
View Inode usage of current disk​
  1. Log in to the target instance. For operation details, refer to Logging in to Linux instances.​
  1. Execute the following command to view the Inode usage.​
  • ​
    df -i​
    ​
  • Sample output​
  • ​​​
  1. If the Inode usage rate reaches or is close to 100%, you need to clean up files or directories with high Inode usage.​
  1. Execute the following commands to confirm the number of files in the root directory / .​
  • ​
    cd /​
    for i in ./*; do echo $i; find $i | wc -l; done​
    ​
  • Sample output​
  • ​​​
  1. Execute the following command to enter the directory with the largest number of files.​
tip​
  • A greater number of files indicates higher Inode usage.​
  • In the example provided in this topic, the usr directory stores the largest number of files.​
  • ​
    cd usr/ ​
    ​
  1. Execute the following command to view which directory in the current directory stores the largest number of files.​
  • ​
    for i in ./*; do echo $i; find $i | wc -l; done​
    ​
  • Sample output​
  • ​​​
  1. Repeat steps b and c to enter the directory with the highest Inode usage (which indicates the largest number of files) level by level until you locate the files or directories with excessive space usage.​
  • Cleanup cannot be performed​
  • If the target file or directory is necessary for business or the system and cannot be cleaned up, you can expand the volume capacity or change the volume specification. This ensures that programs can run normally without being limited by the performance of the volume. For operation details, refer to Expanding volumes and Changing volume specifications.​
  • Cleanup can be performed​
  • If the target file or directory is not necessary, you can execute the following command to forcibly delete the target file and free up disk space.​
warning​
  • Deletion is irreversible. Please proceed with caution.​
  • Replace /usr/local/test_large_file in the command with the actual path of the target file.​
  • ​
    rm -rf /usr/local/test_large_file​
    ​
​
Last updated: 2026.06.18 17:49:51