Linux-linnode Full of Hints

Source: Internet
Author: User

There is a Web server disk detection alarm on the line, the prompt space is insufficient, log on to the server to view

<ignore_js_op>
Touch:cannot Touch ' furm.html ': No space left on device
Use the df-h command to view discovery


<ignore_js_op>

The/data/web partition uses only 2%, and the creation of the file indicates that there is not enough disk space to make this happen. Suspicion is that inode depletion is causing.

Causes of Analysis:
Using Df–i to see that the inode is exhausted, the file cannot be created on the system
<ignore_js_op>



Find causes and resolve

/data/web is the online business Data Catalog, which is caused by a program that produces a large number of small files. You can find the file or directory that occupies the most space by using the following command:

Find/-type d-size +10m
This command is to find a directory larger than 10M (the larger the directory size, the more files in the directory).

A large number of small files are distributed in a large number of directories
CD/
Find */!-type L | cut-d/F 1 | uniq-c

This command is to find out the total number of files in the directory and may need to be executed several times. For example, the above command found a large number of small files in the/data directory, but the/data/directory has a lot of directories, we still need to continue to execute:

cd/data
Find */!-type L | cut-d/-F 1 | uniq-c
until you find a specific directory.


There are too many files under/data/web ls half a day does not respond
with RM-RF * will automatically jump out of root, with Xargs to solve.
# ls | xargs rm–f
At this point, the Df–i command to see the discovery is normal, the creation of the file will not appear error
<ignore_js_op> 



Plus:
       Note that the following directory when the SendMail service is installed but does not open, this directory will temporarily generate a large number of small files, according to the above solution can be resolved.
# cd/var/spool/clientmqueue
# ls | xargs rm–f
Reason analysis: The program that Cron executes in the system has the output content, the output content will send to the cron user in the mail form, These files are generated when the SendMail is not started, and the
Workaround:   add >/dev/null 2>&1

Summary
to the crontab inside the command     Monitoring inode occupancy and receiving inode alarms should use these methods to locate the problem in a timely manner and give feedback to the appropriate personnel to resolve the root cause. In the future encounter similar problems to pay attention to, with Df-i check the use of the inode.





Extension:
View size of block and Inode

1
2
3
4
5
6
7
[[email protected] ~]# dumpe2fs/dev/sdb1 |grep-i "Block size"
DUMPE2FS 1.41.12 (17-may-2010)
Block size:1024

[Email protected] ~]# dumpe2fs/dev/sdb1 |grep-i "Inode size"
DUMPE2FS 1.41.12 (17-may-2010)
Inode size:128





View the total number of blocks and inode (typically block is greater than inode number)

1
2
3
4
5
6
7
[[email protected] ~]# dumpe2fs/dev/sdb1 |grep "Block count"
DUMPE2FS 1.41.12 (17-may-2010)
Block count:524272

[[email protected] ~]# dumpe2fs/dev/sdb1 |grep "Inode count"
DUMPE2FS 1.41.12 (17-may-2010)
Inode count:131072

Linux-linnode Full of Hints

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.