Neither specifying inode ratio nor inode quantity seems to have an effect on mkfs.ext2
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Neither specifying inode ratio nor inode quantity seems to have an effect on mkfs.ext2
Creating Partition to Archive Large files of type Video/ISO. Partition of 302 GiB to have ext2 filesystem, using Kernel 4.9.0. Expect to fit about 350 files in, at most 500. So start with
root@porteus:/home/guest# mkfs.ext2 -b 4096 -m0 -i50331648 /dev/sdb3
mke2fs 1.43.1 (08-Jun-2016)
/dev/sdb3 contains a ext2 file system
last mounted on Sun Jan 22 02:40:04 2017
Proceed anyway? (y,n) y
Creating filesystem with 79167488 4k blocks and 38656 inodes
Filesystem UUID: cd62f259-2a4a-4be8-8d13-a9229e88f119
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
Still 38656 inodes @ 8M/inode.
Inode every 48M (ext4)
Code:
root@porteus:/home/guest# time mkfs.ext4 -b 4096 -m0 -i50331648 /dev/sdb3
mke2fs 1.43.1 (08-Jun-2016)
/dev/sdb3 contains a ext2 file system
created on Sun Jan 22 16:10:58 2017
Proceed anyway? (y,n) y
Creating filesystem with 79167488 4k blocks and 38656 inodes
Filesystem UUID: 2671309d-1c79-455a-9a6b-b9cfd879eb25
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
real 0m20.955s
user 0m0.028s
sys 0m0.457s
No improvement.
MKE2FS Man Page
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.
Code:
root@porteus:/home/guest# time mkfs.ext2 -b 4096 -m0 -N4096 /dev/sdb3
mke2fs 1.43.1 (08-Jun-2016)
/dev/sdb3 contains a ext4 file system
last mounted on Sun Jan 22 17:23:19 2017
Proceed anyway? (y,n) y
Creating filesystem with 79167488 4k blocks and 38656 inodes
Filesystem UUID: b48aacde-ee9f-4ed5-ab6c-ad09bfa8aca3
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
real 0m32.970s
user 0m0.029s
sys 0m0.282s
Still 38656 inodes. No override!
By Way of Experiment
Code:
root@porteus:/home/guest# time mkfs.ext2 -b 8192 -m0 -N 4096 /dev/sdb3
Warning: blocksize 8192 not usable on most systems.
mke2fs 1.43.1 (08-Jun-2016)
/dev/sdb3 contains a ext2 file system
created on Sun Jan 22 21:30:13 2017
Proceed anyway? (y,n) y
mkfs.ext2: 8192-byte blocks too big for system (max 4096)
Proceed anyway? (y,n) y
Warning: 8192-byte blocks too big for system (max 4096), forced to continue
Creating filesystem with 39583744 8k blocks and 19360 inodes
Filesystem UUID: 40711675-e673-4a14-a9cf-66403251f442
Superblock backups stored on blocks:
65528, 196584, 327640, 458696, 589752, 1638200, 1769256, 3210872,
5307768, 8191000, 15923304, 22476104
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
real 0m35.978s
user 0m0.017s
sys 0m0.127s
Looks like for Block Size of 4096 bytes, max of 8 MiB per inode Ratio is Hardcoded in.
Why ext2 ?. That (native) code is so old there have been serious discussions to remove the support for it altogether.
As for trying to force allocation, have a look at "-T". Probably won't work on ext2, but there is no reason to even consider that IMHO.
There are also other (better ?) filesystems for really large file allocation.
^ There is no point in suggesting -T if one has not tried it themselves. The most that -T does is 6 MiB an inode, or something of that order. Example #4 was done with ext4, and resulted in the same limitations. Ext2 does not have journalling, and for my purposes journalling would be just a superfluous overhead .
You can run ext4 without journalling. Best of both worlds - you get the new code for large allocations, extents etc as well.
-T worked fine when I have used it - but only tried it on ext4. I did say it might not be of assistance on ext2.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.