Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9007
  • 博文数量: 2
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 31
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-15 21:34
文章分类
文章存档

2014年(2)

我的朋友

分类: 系统运维

2014-01-02 17:48:01


2011年 9月11日
本人接到所服务的某国家机构运维管理人员的电话,服务器空间1T,但写了300G 的数据后,就提示空间满了,这到底是怎么一回事,他们百思不得其解。
由于服务器是放在涉密网络中,不得已,驱车前往.


如下是诊断步骤:
1. df -h  查看磁盘空间可用。
df -h
/dev/sda3               930G    305G   624G    32% /app

2. df  -ih 查看索引节点空间可用:

df -ih
/dev/sda3               164M    163M    806K   100% /app

通过上面的诊断,并非是磁盘空间满了导致root写不了文件,而是由于索引节点空间满了写不了文件。

3. 进一步分析原因,是什么原因导致了索引节点空间满。
原来使用的300G 的空间中,全是小文件,每个文件大概是7K-8K的文件,所以文件数一多,每个文件都要占用索引空间,最后导致系统默认的索引容量不足,从而导致新的文件无法写入。

4. 什么是inode。

The inode (index node) is a fundamental concept in the Linux and UNIX filesystem. Each object in the filesystem is represented by an inode.

Inodes store information about files and directories (folders), such as file ownership, access mode (read, write, execute permissions), and file type. On many types of file system implementations, the maximum number of inodes is fixed at file system creation, limiting the maximum number of files the file system can hold. A typical allocation heuristic for inodes in a file system is one percent of total size.


inode译成中文就是索引节点,每个存储设备(例如硬盘)或存储设备的分区被格式化为文件系统后,应该有两部份,一部份是inode,另一部份是 Block,Block是用来存储数据用的。而inode呢,就是用来存储这些数据的信息,这些信息包括文件大小、属主、归属的用户组、读写权限等。 inode为每个文件进行信息索引,所以就有了inode的数值。操作系统根据指令,能通过inode值最快的找到相对应的文件。


The inode number indexes a table of inodes in a known location on the device; from the inode number, the file system driver portion of the kernel can access the contents of the inode, including the location of the file allowing access to the file.

A file's inode number can be found using the ls -i command. The ls -i command prints the i-node number in the first column of the report.
(可以通过ls -i 查看一个文件或目录的具体inode)。

5. 什么环境下需要调整inode大小。
大多数情况下,我们在格式化文件系统时候,可以采用默认的方法不对inode进行设置(the default inode size is based on the number of blocks and the bytes-per-inode ratio),但你的系统如果存放的基本全是小碎文件的话,就要进行调整了,因为默认的Inode空间可能已经无法存储索引节点。


参考:



阅读(271) | 评论(0) | 转发(0) |
1

上一篇:没有了

下一篇:postgresql 高可用之流复制标准解决流程

给主人留下些什么吧!~~