[LU-9501] Flag for mke2fs to automatically adjust number of inodes Created: 15/May/17  Updated: 16/Sep/17  Resolved: 16/Sep/17

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Artem Blagodarenko (Inactive) Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: e2fsprogs, patch

Rank (Obsolete): 9223372036854775807

 Description   

In certain cases device size where filesystem is created is not know in advance, and it's impractical to try guess correct inode ratio to satisfy filesystem limitations (which is 4G inodes for ext4 and ldiskfs).
We need a flag to tell mke2fs to limit inode count to match current filesystem limits.
Example of current behavior:

# mke2fs  -i 1024 img
mke2fs 1.42.13.x2 (29-Sep-2016)
mke2fs: too many inodes (5269225472), raise inode ratio?
root@kvkvm1oem(0):~#

Proposed behavior (example only, feel free to change message text):

# mke2fs  -i 1024 --adjust-inode-count img
mke2fs 1.42.13.x2 (29-Sep-2016)
mke2fs: too many inodes (5269225472), changing to <supported FS limit> 
... formatting continues ...


 Comments   
Comment by Andreas Dilger [ 15/May/17 ]

I think if you don't specify "-I" then it will cap the inode count at 4B?

In any case, I think that this should really be a fix in mke2fs and should probably be discussed on the linux-ext4 mailing list?

Comment by Artem Blagodarenko (Inactive) [ 15/May/17 ]

Hello Andreas.

Thank you for quick answer. I am agree that mke2fs requires such useful modification. But this feature is very important now for customers running Lustre FS. Currently users which what to create custom large enough cluster, hit this error message and need to readjust config scripts manually, that stops deployment with other automatic parts. This little fix solves the problem and make customers happy. Can we apply it now and switch to another one from ext4 latter?

Anyway I will upload this patch here. It can be useful if we decide land it or sent patch to linux-ext4.

Thanks.

Comment by Andreas Dilger [ 15/May/17 ]

IMHO, I don't think we even need an option for this? Just limit the inode count to 4B inodes automatically rather than returning an error.

Comment by Gerrit Updater [ 15/May/17 ]

Artem Blagodarenko (artem.blagodarenko@seagate.com) uploaded a new patch: https://review.whamcloud.com/27111
Subject: LU-9501 mke2fs: avoid inode number error with large FS
Project: tools/e2fsprogs
Branch: master-lustre
Current Patch Set: 1
Commit: d8b68ec2ccf56dd97cb7be30188d9f745206e534

Comment by Artem Blagodarenko (Inactive) [ 15/May/17 ]

>Just limit the inode count to 4B inodes automatically rather than returning an error.
This patch exact this idea

Comment by Gerrit Updater [ 16/Sep/17 ]

Andreas Dilger (andreas.dilger@intel.com) merged in patch https://review.whamcloud.com/27111/
Subject: LU-9501 mke2fs: avoid inode number error with large FS
Project: tools/e2fsprogs
Branch: master-lustre
Current Patch Set:
Commit: ec44b0534beb51ce70bb9b997cbbad2476506b2a

Generated at Sat Feb 10 02:26:45 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.