LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 01-22-2017, 06:48 PM   #1
Bogomips_
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Rep: Reputation: Disabled
Question 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
  1. Inode every 64M
    Code:
    root@porteus:/home/guest# mkfs.ext2 -b 4096 -m 0 -i 67108864 /dev/sdb3
    mke2fs 1.43.1 (08-Jun-2016)
    Creating filesystem with 79167488 4k blocks and 38656 inodes
    Filesystem UUID: 3aab194d-8ef5-4905-bbdc-748fdf507674
    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
    Expect just 16 x 302 = 4832 inodes. However have 38656 inodes, giving 8M per inode.
  2. Inode every 512M
    Code:
    root@porteus:/home/guest# mkfs.ext2 -b 4096 -m 0 -i 536870912 /dev/sdb3
    mkfs.ext2: invalid inode ratio 536870912 (min 1024/max 67108864)
  3. Inode every 48M
    Code:
    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.
  4. 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.
  5. 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.
 
Old 01-22-2017, 07:14 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,236

Rep: Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636
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.
 
Old 01-23-2017, 08:26 PM   #3
Bogomips_
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
^ 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 .

Last edited by Bogomips_; 01-23-2017 at 08:28 PM.
 
Old 01-23-2017, 08:49 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,236

Rep: Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636Reputation: 2636
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.
 
Old 01-24-2017, 08:24 PM   #5
Bogomips_
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
You can run ext4 without journalling. Best of both worlds
Thanks for heads up.

Going with it:
  1. High inode density.
    Code:
    root@porteus:/home/guest# mkfs.ext4 -b 4096 -m 0 -T huge -O ^has_journal /dev/sdb3 
    mke2fs 1.43.1 (08-Jun-2016)
    /dev/sdb3 contains a ext2 file system
            created on Sun Jan 22 21:35:29 2017
    Proceed anyway? (y,n) y
    Creating filesystem with 79167488 4k blocks and 4947968 inodes
    Filesystem UUID: eb1bfdd0-78d7-4a82-818a-e3b5589e6718
    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
    
    root@porteus:/home/guest# tune2fs -l /dev/sdb3 | awk -F: ' \
    >     /^Block count:/ { blocks = $2 } \
    >     /^Inode count:/ { inodes = $2 } \
    >     /^Block size:/ { block_size = $2 } \
    >     END { blocks_per_inode = blocks/inodes; \
    >           print "blocks per inode:\t", blocks_per_inode, \
    >                 "\nbytes per inode:\t", blocks_per_inode * block_size }'
    blocks per inode:        16 
    bytes per inode:         65536
  2. 4 MiBs per Inode
    Code:
    root@porteus:/home/guest# mkfs.ext4 -b 4096 -m 0 -T largefile4 -O ^has_journal /dev/sdb3 
    mke2fs 1.43.1 (08-Jun-2016)
    /dev/sdb3 contains a ext4 file system
            created on Tue Jan 24 16:26:10 2017
    Proceed anyway? (y,n) y
    Creating filesystem with 79167488 4k blocks and 77312 inodes
    Filesystem UUID: 7ff6af42-a63f-4e57-a282-38e80a2b9879
    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     
    
    root@porteus:/home/guest# tune2fs -l /dev/sdb3 | awk -F: ' \
        /^Block count:/ { blocks = $2 } \
        /^Inode count:/ { inodes = $2 } \
        /^Block size:/ { block_size = $2 } \
        END { blocks_per_inode = blocks/inodes; \
              print "blocks per inode:\t", blocks_per_inode, \
                    "\nbytes per inode:\t", blocks_per_inode * block_size }'
    blocks per inode:        1024 
    bytes per inode:         4194304
  3. 38656 Inodes
    • -T -i Specified
      Code:
      root@porteus:/home/guest# mkfs.ext4 -b 4096 -m 0 -T largefile4 -O ^has_journal -i 67108864  /dev/sdb3
      mke2fs 1.43.1 (08-Jun-2016)
      /dev/sdb3 contains a ext4 file system
              created on Tue Jan 24 16:35:06 2017
      Proceed anyway? (y,n) y
      Creating filesystem with 79167488 4k blocks and 38656 inodes
      Filesystem UUID: 2b178c74-264f-4f65-b183-61860ca77492
      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
    • -T -i -N Specified
      Code:
      root@porteus:/home/guest# mkfs.ext4 -b 4096 -m 0 -T largefile4 -O ^has_journal -i 67108864  /dev/sdb3
      mke2fs 1.43.1 (08-Jun-2016)
      /dev/sdb3 contains a ext4 file system
              created on Tue Jan 24 16:35:06 2017
      Proceed anyway? (y,n) y
      Creating filesystem with 79167488 4k blocks and 38656 inodes
      Filesystem UUID: 2b178c74-264f-4f65-b183-61860ca77492
      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
  4. Just -N Specified. Again 38656 Inodes.
    Code:
    root@porteus:/home/guest# time mkfs.ext4 -b 4096 -m 0 -N 4096 -O ^has_journal  /dev/sdb3mke2fs 1.43.1 (08-Jun-2016)
    /dev/sdb3 contains a ext4 file system
            created on Tue Jan 24 17:17:04 2017
    Proceed anyway? (y,n) y
    Creating filesystem with 79167488 4k blocks and 38656 inodes
    Filesystem UUID: d5038994-c3be-4403-9750-4d874a944ef2
    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    0m11.345s
    user    0m0.026s
    sys     0m0.188s
    
    
    root@porteus:/home/guest# tune2fs -l /dev/sdb3 | awk -F: ' \
        /^Block count:/ { blocks = $2 } \
        /^Inode count:/ { inodes = $2 } \
        /^Block size:/ { block_size = $2 } \
        END { blocks_per_inode = blocks/inodes; \
              print "blocks per inode:\t", blocks_per_inode, \
                    "\nbytes per inode:\t", blocks_per_inode * block_size }'
    blocks per inode:        2048 
    bytes per inode:         8388608
    Inode Ratio of 8 MiB to the Inode

Looks like will have to report this as a deficiency, which is a bore, but they are apparently short of resources for testing.
 
  


Reply

Tags
ext2fs, inode, limit


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you read from & write to the bootloader inode of an ext2 filesystem? madanra Linux - Software 2 08-11-2014 03:38 PM
questions abt inode.inode gurus plz have a look aceone Red Hat 7 05-22-2011 01:11 PM
LXer: Tips and Tricks: How do I find the inode size of an ext2/ext3 filesystem? LXer Syndicated Linux News 0 07-31-2007 12:01 PM
ext2/ext3 limit of 32,000 links in an inode ogross74 Linux - General 2 10-10-2005 01:52 PM
Multible newbie questions (pppd, ext2 vs ext3, and random inode read errors) (Slack10 Nicolae Slackware 8 08-28-2004 05:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration