Linux inode full workaround

Source: Internet
Author: User
Tags tmp file inode usage

Today, a login server Web site found that login did not generate a session. Based on past experience, the session file generation failure is generally caused by a full space

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/31/3a3089af898212da06a670d5aeee52a0.png-wh_500x0-wm_3 -wmp_4-s_1899893560.png "title=" Qq20171031103046.png "alt=" 3a3089af898212da06a670d5aeee52a0.png-wh_ "/>

Space remaining 473M, you can exclude the situation is full of space. Another reason for file generation failure is that the File index node inode is full

  1. Df-i

  2. Filesystem inodes iused IFree iuse% mounted on

  3. /dev/mapper/dev01-root 4964352 4964352 0 100%/

  4. Udev 503779 503339 1%/dev

  5. Tmpfs 506183 353 505830 1%/run

  6. None 506183 5 506178 1%/run/lock

  7. None 506183 2 506181 1%/RUN/SHM

  8. /DEV/SDA1 124496 255 124241 1%/boot

Inodes occupies 100%, which is really the problem

Workaround: Delete the unused temporary files and release the Inode.

Find a session temp file that has many sess_xxxxx in the/tmp directory

    1. ls-lt/tmp | Wc-l

    2. 4011517

Enter/tmp directory, execute find-exec command

Find/home-type f-exec rm {} \;

If you use RM *, it is possible that the argument list too long error occurs because of too many files. The reason is that under Linux, trying to pass too many parameters to a system command (LS *; CP *; RM *; cat *; etc..) , a Argument list too long error occurs.

In addition to the TEMP. tmp file, the 0-byte file will also occupy the inode and should be freed.

Traverse looking for 0 bytes of file and delete

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

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

  1. Df-i

  2. Filesystem inodes iused IFree iuse% mounted on

  3. /dev/mapper/dev01-root 4964352 940835 4023517 19%/

  4. Udev 503779 503339 1%/dev

  5. Tmpfs 506183 353 505830 1%/run

  6. None 506183 5 506178 1%/run/lock

  7. None 506183 2 506181 1%/RUN/SHM

  8. /DEV/SDA1 124496 255 124241 1%/boot


Linux inode full workaround

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.