[文章作者:张宴 本文版本:v1.0 最后修改:2007.09.12 转载请注明出处:http://blog.zyan.cc]
一、发现问题:
在一台配置较低的Linux服务器(内存、硬盘比较小)的/data分区内创建文件时,系统提示磁盘空间不足,用df -h命令查看了一下磁盘使用情况,发现/data分区只使用了66%,还有12G的剩余空间,按理说不会出现这种问题。
二、分析问题:
后来用df -i查看了一下/data分区的索引节点(inode),发现已经用满(IUsed=100%),导致系统无法创建新目录和文件。

inode译成中文就是索引节点,每个存储设备(例如硬盘)或存储设备的分区被格式化为文件系统后,应该有两部份,一部份是inode,另一部份是Block,Block是用来存储数据用的。而inode呢,就是用来存储这些数据的信息,这些信息包括文件大小、属主、归属的用户组、读写权限等。inode为每个文件进行信息索引,所以就有了inode的数值。操作系统根据指令,能通过inode值最快的找到相对应的文件。
而这台服务器的Block虽然还有剩余,但inode已经用满,因此在创建新目录或文件时,系统提示磁盘空间不足。
三、查找原因:
/data/cache目录中存在数量非常多的小字节缓存文件,占用的Block不多,但是占用了大量的inode。
四、解决方案:
1、删除/data/cache目录中的部分文件,释放出/data分区的一部分inode。
2、用软连接将空闲分区/opt中的newcache目录连接到/data/cache,使用/opt分区的inode来缓解/data分区inode不足的问题:
ln -s /opt/newcache /data/cache
3、更换服务器,用高配置的服务器替换低配置的服务器。很多时候用钱去解决问题比用技术更有效,堆在我办公桌上5台全新的 DELL PowerEdge 1950 服务器即将运往IDC机房。



一、发现问题:
在一台配置较低的Linux服务器(内存、硬盘比较小)的/data分区内创建文件时,系统提示磁盘空间不足,用df -h命令查看了一下磁盘使用情况,发现/data分区只使用了66%,还有12G的剩余空间,按理说不会出现这种问题。
二、分析问题:
后来用df -i查看了一下/data分区的索引节点(inode),发现已经用满(IUsed=100%),导致系统无法创建新目录和文件。

inode译成中文就是索引节点,每个存储设备(例如硬盘)或存储设备的分区被格式化为文件系统后,应该有两部份,一部份是inode,另一部份是Block,Block是用来存储数据用的。而inode呢,就是用来存储这些数据的信息,这些信息包括文件大小、属主、归属的用户组、读写权限等。inode为每个文件进行信息索引,所以就有了inode的数值。操作系统根据指令,能通过inode值最快的找到相对应的文件。
而这台服务器的Block虽然还有剩余,但inode已经用满,因此在创建新目录或文件时,系统提示磁盘空间不足。
三、查找原因:
/data/cache目录中存在数量非常多的小字节缓存文件,占用的Block不多,但是占用了大量的inode。
四、解决方案:
1、删除/data/cache目录中的部分文件,释放出/data分区的一部分inode。
2、用软连接将空闲分区/opt中的newcache目录连接到/data/cache,使用/opt分区的inode来缓解/data分区inode不足的问题:
ln -s /opt/newcache /data/cache
3、更换服务器,用高配置的服务器替换低配置的服务器。很多时候用钱去解决问题比用技术更有效,堆在我办公桌上5台全新的 DELL PowerEdge 1950 服务器即将运往IDC机房。



mr

2022-6-1 23:27
There's no doubt i would fully rate it after i read what is the idea about this article. You did a nice job.. https://www.ccchristiantheatre.org/
mr

2022-6-1 23:29
I have express a few of the articles on your website now, and I really like your style of blogging. I added it to my favorite’s blog site list and will be checking back soon… https://www.allencompassingretreats.com/
mr

2022-6-1 23:35
Cool stuff you have and you keep overhaul every one of us https://www.visforveggies.com/
mr

2022-6-1 23:39
I need to to thank you for this very good read!! I definitely loved every little bit of it. I have you bookmarked to check out new things you post… https://www.solardecathlon-alfred.org/
mr

2022-6-1 23:42
A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one. https://www.dncreativekids.com/
mr

2022-6-1 23:44
I want you to thank for your time of this wonderful read!!! I definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! https://www.dbartholomew.net/
mr

2022-6-1 23:45
Please give some advice on how to achieve this kind of posts. https://www.orlandointernships.net/
mr

2022-6-1 23:47
You completely match our expectation and the variety of our information. https://www.indepenliving.com/
mr

2022-6-1 23:48
My friend mentioned to me your blog, so I thought I’d read it for myself. Very interesting insights, will be back for more! https://www.glennpooloilfield.org/
分页: 3/3
1 2 3


