In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article to share with you is about Linux inode occupation 100% how to solve, Xiaobian feel quite practical, so share to everyone to learn, I hope you can read this article after some gains, not much to say, follow Xiaobian to see it.
What is an inode?
Files are stored on a hard disk, and the smallest unit of storage on a hard disk is called a sector. Each sector stores 512 bytes (equivalent to 0.5KB).
When the operating system reads the hard disk, it does not read it sector by sector, which is too inefficient, but reads multiple sectors at once, that is, reads a "block" at a time. This "block" of multiple sectors is the smallest unit of file access. The most common size of "block" is 4KB, that is, eight consecutive sectors form a block.
File data is stored in "blocks," so obviously we must also find a place to store file metadata, such as the file creator, the date the file was created, the file size, and so on. This area where the meta-information of the file is stored is called an inode, translated into Chinese as "index node."
Each file has an inode that contains information about the file.
How to check the innode occupancy of a system
df -ih
How to find the most files in that directory
First go to the root directory/
cd /
then perform
for i in /*; do echo $i; find $i | wc -l; done
or
for i in `ls -1A | grep -v "\.\./ " | grep -v "\./ "`; do echo "`find $i | sort -u | wc -l` $i"; done | sort -rn | head -10
This will return to the directory with the most files under/directory in turn, enter this directory, and then execute the above command, so that the layers of depth will finally determine which directory has the most files.
How to delete all files in that directory
In general, if there should be millions of files in this directory, it will be inefficient if you use rm-rf directory name directly. You can use the following method
find directory-type f -name '*' -print0| xargs -0 rm
It may take a long time, so you'd better open a screen to deal with it.
It is possible that you have encountered the following situation
The requested URL/var/spool/postfix/was not found on this server.
To avoid this, you can execute crontab -e
Add MAILTO='"' at the beginning, then server crond restart Restart crond
The above is how to solve 100% inode occupation in Linux. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.