Linux inode full solution, linuxinode

Source: Internet
Author: User
Tags server website inode usage

Linux inode full solution, linuxinode

Solution to linux inode full


Today, a login server website finds that no session is generated after login. Based on past experience, it is generally because the space is full and the session file generation fails.

df -hFilesystem                    Size  Used Avail Use% Mounted on/dev/mapper/dev01-root         75G   58G   14G  82% /udev                          2.0G  4.0K  2.0G   1% /devtmpfs                         396M  292K  396M   1% /runnone                          5.0M     0  5.0M   0% /run/locknone                          2.0G  4.0K  2.0G   1% /run/shm/dev/sda1                     228M  149M   68M  69% /boot

14 GB space remaining. Another cause of file generation failure is that the inode of the file index node is full.

df -iFilesystem                    Inodes   IUsed  IFree IUse% Mounted on/dev/mapper/dev01-root       4964352 4964352      0  100% /udev                          503779     440 503339    1% /devtmpfs                         506183     353 505830    1% /runnone                          506183       5 506178    1% /run/locknone                          506183       2 506181    1% /run/shm/dev/sda1                     124496     255 124241    1% /boot

Inodes occupies 100%, which is indeed a problem.


Solution:Delete useless temporary files and release inode.

Find and find many session temporary files in the/tmp directory.

ls -lt /tmp | wc -l4011517

Go to the/tmp directory and run the find-exec command.

sudo find /tmp -type f -exec rm {} \;

If rm * is used, the Argument list too long error may occur due to the large number of files. For details about the Argument list too long error, refer to linux Argument list too long error solution.


In addition to the temporary/tmp files, 0-byte files also occupy inode and should also be released.

Search for 0-byte files and delete them.

sudo find /home -type f -size 0 -exec rm {} \;

After deletion, inode usage is reduced to 19% and can be used normally.

df -iFilesystem                    Inodes  IUsed   IFree IUse% Mounted on/dev/mapper/dev01-root       4964352 940835 4023517   19% /udev                          503779    440  503339    1% /devtmpfs                         506183    353  505830    1% /runnone                          506183      5  506178    1% /run/locknone                          506183      2  506181    1% /run/shm/dev/sda1                     124496    255  124241    1% /boot


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.