How to change inode_ratio (bytes-per-inode) from within the kickstart script on RHEL 6.9?

Latest response

How do I change (reduce) inode_ratio (bytes-per-inode from default 16K to 8K) from within the kickstart script on RHEL6.9 ? Basically, I need to increase the number of inodes during installation of the OS right from the kickstart script while creating the ext4 type file partitions.

My /etc/mke2fs.conf has default "inode_ratio = 16384". I tried the following from kickstart "part" line -

part /data --bytes-per-inode=8192 --fstype=ext4 ....

It did not work; bytes-per-inode was still 16K. Now I know that the part "--bytes-per-inode" option is obsolete.

Do I directly change inode_ratio from 16384 to 8192 in /etc/mke2fs.conf file using sed or awk from kickstart script before the "part" lines? I am not sure if the corresponding package (rpm) e2fsprogs that provides /etc/mke2fs.conf file will be installed already at that point.

Responses

The "bytes-per-inode" is deprecated in RHEL6.x, please check this KB https://access.redhat.com/solutions/159373

Also, check this https://access.redhat.com/solutions/61400.

It looks that you've to create a fsprofile first in "%pre" section and then use that name later while specifying file system.

Hello Sadashiva,

Thanks for the hint. I will give it a try!

  • Arefin

The solution is in https://access.redhat.com/solutions/61400

Thanks Sadashiva for the link!

Nice to hear that you fixed it.

But one thing I do not understand - why the new fsprofile is not seen in /etc/mke2fs.conf file?

I thought I was appending a new fsprofile to an existing /etc/mke2fs.conf file provided by the package "e2fsprogs"! Looks like I actually ended up creating a new little /etc/mke2fs.conf file from %pre, and it was actually used during the creation of the partition! Otherwise, I would not see the increased number of INODEs. And at some point, e2fsprogs package was installed and my little /etc/mke2fs.conf file was overwritten.

I guess, /sbin/mke2fs or /sbin/mkfs.ext4 actually creates the partition. Both these tools are provided by e2fsprogs package. Therefore, this package must have been already installed, and the new fsprofile should be appended to the already installed /etc/mke2fs.conf file.

I am confused about the sequence of events here! Any insight to this would be greatly appreciated!

Thanks.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.