每个inode多少个字节? [英] How many bytes per inodes?
问题描述
我需要创建非常大的文件(不是很大)(例如4kb,8kb). 在我的计算机上这是不可能的,因为它将所有inode占用高达100%,并且我无法创建更多文件:
I need to create a very high number of files which are not very large (like 4kb,8kb). It's not possible on my computer cause it takes all inodes up to 100% and I cannot create more files :
$ df -i /dev/sda5
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda5 54362112 36381206 17980906 67% /scratch
(我开始删除文件,这就是为什么现在是67%)
(I started deleting files, it's why it's now 67%)
我的文件系统(ext4)上的每个节点的字节数为256
The bytes-per-nodes are of 256 on my filesystem (ext4)
$ sudo tune2fs -l /dev/sda5 | grep Inode
Inode count: 54362112
Inodes per group: 8192
Inode blocks per group: 512
Inode size: 256
我想知道是否有可能将这个值设置得很低,甚至低于128(在重新格式化期间).如果是,我应该使用什么值? 谢谢
I wonder if it's possible to set this value very low even below 128(during reformating). If yes,what value should I use? Thx
推荐答案
每个inode的默认字节通常为16384,这是/etc/mke2fs.conf
中的默认inode_ratio
(在创建文件系统之前读取).如果您用尽了inode,则可以尝试例如:
The default bytes per inode is usually 16384, which is the default inode_ratio
in /etc/mke2fs.conf
(it's read prior to filesystem creation). If you're running out of inodes, you might try for example:
mkfs.ext4 -i 8192 /dev/mapper/main-var2
另一个会影响此效果的选项是-T
,通常是-T news
,它将进一步减小到4096.
Another option that affects this is -T
, typically -T news
which further reduces it to 4096.
此外,您不能在ext3或ext4文件系统中更改inode的数量,除非重新创建或对其进行十六进制编辑. Reiser文件系统是动态的,因此您永远不会遇到问题.
Also, you can not change the number of inodes in a ext3 or ext4 filesystem without re-creating or hex-editing it. Reiser filesystems are dynamic so you'll never have an issue with them.
这篇关于每个inode多少个字节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!