Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

500 problems caused by full index nodes (inode) in linux No space left on device

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

What is inode?

To understand inode, start with file storage.

Files are stored on the hard disk, and the smallest storage unit of the hard disk is called the "Sector". Each sector stores 512 bytes (equivalent to 0.5KB).

When the operating system reads the hard disk, it will not read it sector by sector, which is too inefficient, but read multiple sectors in succession at one time, that is, read a "block" at one time.

This "block", which consists of multiple sectors, is the smallest unit of file access. The most common size of a "block" is 4KB, that is, eight consecutive sector form a block.

File data is stored in "blocks", so obviously we must also find a place to store the meta-information of the file, such as the creator of the file, the date the file was created, the size of the file, and so on.

The area where the meta-information of the file is stored is called inode, which is translated into Chinese as "index node".

Recently, the website editor failed to upload pictures, and the website page often made 500 errors.

General 500 error search https://www.jb51.net/article/175431.htm looked around and found no problem with the configuration.

Checked the nginx error error log and found that the disk space was full.

I checked the disk usage with the df-h command and found that there was still space left.

Found a problem: later looked at the index node (inode) with df-I and found that it was full (IUsed=100%), causing the system to fail to create new directories and files.

Solution: delete useless temporary files and release inode.

You can see that there are many temporary files in the / tmp directory.

You can also select the / var/spool/ directory

Enter the command to view the number of files under / var/spool/

For i in / var/spool/; do echo $I; find $I | wc-l | sort-nr; done

See more than 2 million documents

Cd / var/spool/clientmqueue/ enter this directory, delete these useless files, and take a look at 600000 files. There are too many files.

So this command was used:

Ls | xargs rm-rf

2 or this command

Find. -name "*" | xargs rm-rf

You can delete files in batches. The following figure shows the effect after deletion: inode uses 21%. Okay

It is because the junk files have not been cleaned for a long time, it takes too much time to clean up the files. In order to avoid such problems, it is best to clean up the junk files of the system regularly, or deploy the monitoring system.

According to the file occupancy of a larger directory, you can temporarily transfer some files to a directory with a smaller disk footprint.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report