GNU/Linux >> Linux の 問題 >  >> Linux

ext2/ext3/ext4 ファイルシステムの inode サイズを調べる方法は?

tune2fs を使用する オプション -l を使用したツール 、ファイルシステムのinodeサイズが見られました。同じオプションを使用すると、ファイルシステム スーパーブロックの他の情報も表示できます。 スーパーブロック 利用可能な空きブロックの数やマウントの数など、チューニングの目的に役立つファイルシステムに関する情報が含まれています。

以下は、ユーザーが -l オプションを指定する方法の例です。ここで使用されている例は、RHEL 7 システムのものです:

# tune2fs -l /dev/sda1 
tune2fs 1.42.9 (28-Dec-2013)
Filesystem volume name:   [none]
Last mounted on:          /boot
Filesystem UUID:          1a678f4f-85e4-43c6-b4b3-af1a732510ac
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              65536
Block count:              262144
Reserved block count:     13107
Free blocks:              228732
Free inodes:              65200
First block:              0
Block size:               4096
Fragment size:            4096
Group descriptor size:    64
Reserved GDT blocks:      127
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
RAID stride:              64
RAID stripe width:        64
Flex block group size:    16
Filesystem created:       Tue Jan 26 18:26:17 2016
Last mount time:          Sun Jun 26 00:03:14 2016
Last write time:          Sun Jun 26 00:03:14 2016
Mount count:              5
Maximum mount count:      -1
Last checked:             Tue Jan 26 18:26:17 2016
Check interval:           0 ([none])
Lifetime writes:          176 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:	          256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      27bb8d92-09a4-4734-89b8-f767a5f34fb3
Journal backup:           inode blocks

i ノードのサイズを取得するには、次を使用します:

# tune2fs -l /dev/sda1 | grep -i inode
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Inode count:              65536
Free inodes:              65200
Inodes per group:         8192
Inode blocks per group:   512
First inode:              11
Inode size:	          256
Journal inode:            8
Journal backup:           inode blocks

上記のように、ext4 システム上の RHEL 7 の inode サイズは 256 バイトです。

df -i を使用することもできます コマンドを使用して、使用可能な inode の総数と、そのうちのいくつが既に使用されているかを取得します。

# df -i /dev/sda1
Filesystem     Inodes IUsed IFree IUse% Mounted on
/dev/sda1       65536  1919 63617    3% /boot

作成前に ext4/etx3 FS の inode 数を計算する方法

マニュアルページに書かれているように、値はブロック数と inode あたりのバイト数の比率に基づいています。

   -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.

持つ inode の数を確認するには、mkfs.ext3/4 で -n オプションを使用します。

# mkfs.ext4 -n /dev/sda
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=512 blocks
32768 inodes, 131072 blocks
6553 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=33685504
16 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
    8193, 24577, 40961, 57345, 73729


Linux
  1. Ext2、Ext3、Ext4Linuxファイルシステムの機能と違い

  2. Ext4ファイルシステムのiノードの数を増やす方法は?

  3. Linux mkfs、mke2fs コマンドの例 (ext2、ext3、ext4 ファイルシステムの作成)

  1. Linuxのソケットバッファサイズを見つける方法

  2. パーティションが ext2、ext3、または ext4 であるかどうかはどうすればわかりますか?

  3. 新しい ext4 インライン データ機能の使用方法(inode に直接データを保存する)

  1. LinuxでExt2/Ext3ファイルシステムをExt4に移行する方法

  2. Linuxでマウントされていないパーティションのサイズを見つける方法は?

  3. fdisk -l などのコマンドはどのようにセクター サイズを見つけますか?