Hard drive fails to write to file failure handling for Debian system inode occupancy 100%

Source: Internet
Author: User
Tags file size file system disk usage

Debian system, only one partition, the Web server, recently found that the inode use frankness 100%, deleted some files, but later up to 100%, how to solve? Or is there any way to see which files are increasing and occupying the inode? Thank you!

FileSystem inodes iused ifree iuse% mounted on

/dev/sda2 17793024 17791412 1612 100%/

Udev 1021529 553 1020976 1%/dev failure phenomenon

The partition cannot write to the file.

  Fault analysis

Execute df-h command found that space occupies less than 70%, the implementation of Df-hi, found that a partition iuse% value of 100%, indicating that the inode has been used up, should be in some directories exist a large number of small files caused.

  Solving method

There are two possibilities for a large number of small file distributions, one is that there are a large number of small files in one or a few directories, and in this case we can use the following command to find the exception directory:

Find/-type d-size +10m

This command is to find a directory size greater than 10M (the larger the directory size, the more files in the directory are represented).

The second possibility is that a large number of small files are distributed in a large number of directories, at which point the command may not find an exception directory, the following commands are required:

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 performed several times until a specific directory is found. For example, the above command found a large number of small files in the/data directory, but the/data/directory also has a lot of directories, this time we need to continue to execute:

Cd/data

Find * *! -type L | cut-d/F 1 | Uniq-c

Until you find the specific directory.

  Fault Summary

To monitor the inode occupancy, and to receive the inode alarm should be used in time to locate the problem, and feedback to the corresponding personnel from the root of the solution.

First, find the problem:

In a lower-configured Linux server (memory, hard disk is relatively small) in the/data partition to create a file, the system prompts the disk space is not enough, with the df-h command to view the disk usage, found that/data partition only used 66%, and 12G of the remaining space, it is not supposed to appear this problem.

Ii. Analysis of issues:

Later, Df-i looked at the/data partition's index node (inode) and found that it was full (iused=100%), causing the system to create new directories and files.

The inode translates into Chinese is the index node, each storage device (such as hard disk) or storage device partition is formatted into the file system, there should be two parts, one is the inode, the other part is Block,block is used to store data. The inode is the information that is used to store the data, including the file size, the owner, the attribution user group, the read and write permissions, and so on. The Inode indexes information for each file, so there is a value for the inode. The operating system according to the instruction, can through the Inode value the quickest to find the corresponding file.

The server's block is still available, but the inode is full, so when you create a new directory or file, the system prompts for insufficient disk space.

  Third, find the reason:

There are a very large number of small byte cache files in the/data/cache directory, and the block is not much occupied, but it takes up a lot of inode.

Iv. Solutions:

1, delete some files in the/data/cache directory, release part of the/data partition Inode.

2, the Newcache directory in the free partition/opt is connected to/data/cache with soft connection, and the inode of/OPT partition is used to alleviate the problem that the inode of the/data partition is insufficient:

Ln-s/opt/newcache/data/cache

3, replace the server, with a highly configured server to replace the low configuration of the server. A lot of times it's more efficient to solve problems with money than with technology, and 5 new DELL PowerEdge 1950 servers on my desk are about to be shipped to IDC room.

There is a TMP directory, with ls command, direct card dead, suddenly understand a lot of documents, and then knock into the RM-RF command and jammed, shut down the machine to sleep, this morning, the use rate of the inode dropped to 50% ^_^

Linux every file has some meta information such as the creation time, file size, file name, and so on, the meta information exists in the inode. So if there are too many small files, maybe the disk is not full but the inode space has been allocated, then the disk is full of the same can't write

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.