Link to home
Start Free TrialLog in
Avatar of LittleJohn101
LittleJohn101Flag for United States of America

asked on

Problem with too many inodes? Good number of inodes to set during format?

We are running several computers with Ubuntu Server 12.04 64 bit. In each of our systems we have seven 3TB hard disks in a RAID-5, for a total of 18TB of usable space. This space is used to store millions of JPG files to retain security camera footage using the free digital video recorder software Zoneminder. We format the single 18TB partition using FDISK and use the following command to create the EXT4 partition:
mkfs.ext4 -i 8192 /dev/sd[x]

Open in new window


For me, this results in 2,197,635,072 inodes, or 1,024 inode blocks per group (whatever that means). This is considerably more than necessary since my disk is full and I have the desired retention I need, yet still have 2,038,999,823 inodes. So this means I really only need about 200,000,000 or less inodes. My issue is i'm not sure how to format the partition to get around that desired amount of inodes.

I'm hoping someone here with good understanding of this can just give me the answer. The 8192 bytes per inode certainly gave us enough inodes, but a couple of my systems have been suffering from file system errors which I think may be related to possibly having too many inodes. One of the errors seen during a fsck was "inode #1718459210 has 14 multiply-claimed block(s), shared with 1 file(s)" and then it specifies the file.

How can I get this partition down to around 200,000,000 or less inodes? Using a calculation found here, I determined that I could set the bytes per inode value to 98,304. My question is, how many inodes will this give me and how will this affect my file system? What potential problems could arise? Is there a better number I could use?
20141231-095027-resized.jpg
SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LittleJohn101

ASKER

Great explanations. Thanks for the help.
The drive needs to store about 170,000 JPEG files that range from about 40,000 bytes to 55,000 bytes. I think i'll set bytes per inode to 32,768. Any more, and I probably won't have enough inodes.
Best is to not set anything and use filesystem that does not limit inodes like XFS (default in RHEL7, usable with Debian* too, not for root FS on RHEL6)
18TB /64k = 3 million inodes more than 170,000 files that you are looking at.

The only time a system runs out of inodes, is when it is setup to store huge files, but instead there are small 1k files instead and I've only seen it once, on a storage system Netapp, where inodes can be increased when needed without reformating the storage space.
XFS " 18TB/0 = unlimted number of inodes.