Use df -h command to view disk space usage is not high, there are a lot of free space, but has been given disk is full when you create a file or write data

Questions about disk space, or with a lot of full index node, thereby to share with you:

First, identify problems

When you create a configuration file company lower Linux server (memory, hard drive is relatively small) of the / data partition, the system prompts insufficient disk space, use the command df -h checked the disk usage, find / data partition use only 66%, and 12G of free space, and normally would not be such a problem.

Second, the analysis of the problem :

Later, with df -i checked the inode / data partition (inode), has been found with a full (IUsed = 100%), the system can not create new directories and files. [Root @ bastion-IDC ~] # df -i Filesystem Inodes IUsed IFree IUse% Mounted on ....... ....... / dev / mapper / VolGroup-lv_home 53452800 53452800 0 100% / data inode translated into Chinese is the index nodes, each storage device (such as a hard disk) after the partition or storage device is formatted as file systems, there should be two segments, one is the inode, the other part is Block, Block is used to store data. The inode, that is used to store the data information, the information including the file size, owner, ownership of the group and access permissions. inode index information for each file, so there is a value of the inode. Operating system according to the instructions, can find the fastest inode value corresponding file.

And Block this server though there is a surplus, but the inode has a full, so when you create a new directory or file, the system prompts insufficient disk space.

Third, find out the reasons:

Very much / data / cache directory in the presence of a small number of bytes of cache files, taking up much of the Block, but take up a lot of inode.

Fourth, the solution:

1) delete some files / data / cache directory, releasing a portion of the inode / data partition, with particular attention to those out of the spool file, this file will generally take up more nodes, because the relatively small and fragmented, while pay more attention to the log file information

2) with a soft connection free partition / opt directory in newcache connection to / data / cache, use / opt inode partitions to alleviate the shortage of the / data partition inode question: # ln -s / opt / newcache / data / cache

3) Replace the server, the server configured by replacing the lower high-server configuration. Many times with the money to solve problems more effectively than with the technology, piled on my desk on 5 brand new DELL PowerEdge 2950 server is about to be shipped IDC room. It is generally not recommended

************************************************** ************************************************** ********* inode on disk full 100% - i node outbreak reasons: usually find the disk is not full but not write file. Tip "no space left on device" with df -i to see, should find the corresponding partition is 100% are generally the crontab job in question, resulting in / var / spool / clientmqueue generated a lot of fragmented files. Approach: with rm -rf * will not be deleted, and there will be a prompt to the effect that too many parameters. There are many ways, I mentioned here a random write, execute the command in / var / spool / clientmqueue / under: "lsattr ./|awk -F" / " '{print $ 3}' | xargs -i rm - rf {} "./ properties listed below with a file name lsattr, removed name in awk, then there is a method of comparing rm -rf commonly used:" find / var / spool / clientmqueue / -type f -exec rm {} \; "or at / var / spool / clientmqueue / directory" find ./ -exec rm {} \ ; " no directional output crontab the rows add the final"> / dev / null 2> & 1 "operation during deleted. Or stop crontab, plus redirection.

************************************************************************************************************

no space left on device solutions:

Inadequate server disk, df -h look, var Normally, there is a surplus, the problem is not found, and later displayed a lot of No space left on device:

/ Var obviously there is a lot of space, why prompt "not enough space" of it to use the results of the node df -i command to view disk found in the following figure?:

100% of the nodes.

This time the user can look at whether the log file too if log files take up a lot of inodes expired at cleaning up the log can be temporarily released.

The following are checking inodes full one situation, for reference only:

View the original sentence crontab inside the regular implementation There is no added> / dev / null 2> & 1, program the system cron execution of the output contents, output contents will be sent cron users by mail, and sendmail does not start so we had a a lot of fragmented files:

 cd / var / spool / clientmqueue / into this directory, delete these useless files, use ls to see what the result is no response, too many files, so he uses this command: ls | xargs rm -rf in batches the process of deleting files, the following chart is the effect of deleting:

Operation to this step, according to the occupancy of large directory files, temporary files to take up part of the transfer disk smaller directory.

Transfer: https://cloud.tencent.com/developer/article/1025981?from=10680

Guess you like

Origin www.cnblogs.com/guanbin-529/p/12101319.html