tags:

views:

41

answers:

1

HI, 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 :

-bash-4.0$ df -i /dev/sda5
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda5            54362112 36381206 17980906   67% /scratch

(I started deleting files, it's why it's now 67%)

The bytes-per-nodes are of 256 on my filesystem (ext4)

-bash-4.0$ sudo tune2fs -l /dev/sda5 | grep Inode
Inode count:              54362112
Inodes per group:         8192
Inode blocks per group:   512
Inode size:           256

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

A: 

I have found solution to my problem on the mke2fs man page :

-I inode-size

Specify the size of each inode in bytes. mke2fs creates 256-byte inodes by default. In kernels after 2.6.10 and some earlier vendor kernels it is possible to utilize inodes larger than 128 bytes to store extended attributes for improved performance. The inode-size value must be a power of 2 larger or equal to 128. The larger the inode-size the more space the inode table will consume, and this reduces the usable space in the filesystem and can also negatively impact performance. Extended attributes stored in large inodes are not visible with older kernels, and such filesystems will not be mountable with 2.4 kernels at all. It is not possible to change this value after the filesystem is created.

The maximun you will be able to set is given by your block-size.

sudo tune2fs -l /dev/sda5 | grep "Block size"
Block size:               4096

Hope this can help....

oyo