LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how many bytes per inodes? (https://www.linuxquestions.org/questions/linux-newbie-8/how-many-bytes-per-inodes-831841/)

oyo 09-13-2010 03:13 AM

how many bytes per inodes?
 
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 :

Code:

-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)

Code:

-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

sem007 09-13-2010 04:08 AM

Quote:

Originally Posted by oyo (Post 4095841)
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 :

Code:

-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)

Code:

-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

You can use -i option with mke2fs command.

Quote:

-i bytes-per-inode
Specify the bytes/inode ratio......
Read manpage for more details.

Regards,

oyo 09-13-2010 04:25 AM

Thx,
yes I know about this option. I just wonder if I could set this value to 64 or 32 for instance. In mke2fs man page, it's said that
Quote:

This value generally shouldn't be smaller than the blocksize of the filesystem
. It's not mandatory, so I think I can
set this value very low. It's just to be sure that I'm not doing something wrong.
It will be a slow filesystem, but still operational no?

sem007 09-13-2010 05:00 AM

Quote:

Originally Posted by oyo (Post 4095880)
Thx,
yes I know about this option. I just wonder if I could set this value to 64 or 32 for instance. In mke2fs man page, it's said that
. It's not mandatory, so I think I can
set this value very low. It's just to be sure that I'm not doing something wrong.
It will be a slow filesystem, but still operational no?

-i option set block size.

Code:

# tune2fs -l /dev/sdb1
.......
Inode count:              50200
Block count:              200780
Reserved block count:    10039
Free blocks:              186617
Free inodes:              50189
First block:              1
Block size:              1024
.......

-I used to set inode size. You can't set it to below 128. (128 min)

Code:

mke2fs -I 64 /dev/sdb1
mke2fs 1.39 (29-May-2006)
mke2fs: invalid inode size 64 (min 128/max 1024)

Hope this help

Regards,

oyo 09-13-2010 06:08 AM

Yes,
I didn't read the entire man page..... :/
Quote:

The inode-size value must be a power of 2 larger or equal to 128.
thank you for help

druuna 09-13-2010 06:47 AM

Hi,

You might also have a look at the -N option.

Quote:

-N number-of-inodes
Overrides the default calculation of the number of inodes that
should be reserved for the filesystem (which is based on the
number of blocks and the bytes-per-inode ratio). This allows
the user to specify the number of desired inodes directly.
Hope this helps.


All times are GMT -5. The time now is 02:41 PM.