Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
sudo mke2fs
Usage: mke2fs [-c|-l filename] [-b block-size] [-C cluster-size]
    [-i bytes-per-inode] [-I inode-size] [-J journal-options]
    [-G flex-group-size] [-N number-of-inodes]
    [-m reserved-blocks-percentage] [-o creator-os]
    [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory]
    [-O feature[,...]] [-r fs-revision] [-E extended-option[,...]]
    [-t fs-type] [-T usage-type ] [-U UUID] [-jnqvDFKSV] device [blocks-count]

[-i bytes-per-inode] [-I inode-size] what are the differences between these 2?

To me, "bytes per inode" and "inode size", do not see difference at all

share|improve this question

1 Answer 1

You should always try and see if the man page (man mke2fs) is more informative than the help:

   -i bytes-per-inode
          Specify the bytes/inode ratio.  mke2fs  creates  an  inode  for
          every  bytes-per-inode  bytes of space on the disk.  The larger
          the bytes-per-inode ratio, the fewer inodes  will  be  created.
          This value generally shouldn't be smaller than the blocksize of
          the filesystem, since in that case more inodes  would  be  made
          than  can  ever  be used.  Be warned that it is not possible to
          expand the number of inodes on a filesystem after  it  is  cre‐
          ated, so be careful deciding the correct value for this parame‐
          ter.

   -I inode-size
          Specify the size  of  each  inode  in  bytes.   mke2fs  creates
          256-byte  inodes  by default.  In kernels after 2.6.10 and some
          earlier vendor kernels it is possible to utilize inodes  larger
          than  128  bytes to store extended attributes for improved per‐
          formance.  The inode-size value must be a power of 2 larger  or
          equal  to  128.   The  larger the inode-size the more space the
          inode table will consume, and this reduces the usable space  in
          the  filesystem  and  can  also  negatively impact performance.
          Extended attributes stored in large inodes are not visible with
          older  kernels, and such filesystems will not be mountable with
          2.4 kernels at all.  It is not possible to  change  this  value
          after the filesystem is created.

To me this reads as that with -I you specify a fixed size which is independent of the disk size (which might be inappropriate for your disk's size). And with -i you set the number of inodes, which takes into account the disk's size.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.