特定の数のinodeでLinodeを設定するには?

特定の数のinodeでLinodeを設定するには?

通常、人々はLinodeを作成するときに計画を選択し、Linuxディストリビューションを展開して割り当てるディスクの量を選択します。通常、スワップパーティションとプライマリパーティションがあります。

しかし、それを行うと、ファイルシステムは特定の数のinodeを生成します!それでは、特定の数のinodeを使用してLinode(Ubuntu 12.04 KTS)を設定する方法は?

私はLinuxファイルシステムについてよくわかりません。

ベストアンサー1

ドライブを直接パーティション化するオプションがある場合は、パーティション内のinodeの数を決定できます。

具体的な方法は次のとおりです。

いくつかの計算を実行し、コマンド-iでこのオプションを使用してmkfs.*生成するinodeの数を決定できます。

 -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 created, so be careful deciding the correct value for this parameter.

計算を簡単にするために、ドライブのサイズが10,000,000バイトであると仮定し、次のようにします。

mkfs.ext4 -i 1000 /dev/yourdrive

ドライブをフォーマットして1000バイトごとに1つのinodeを作成するので、10,000,000バイトのドライブでは10,000個のinodeを作成します。デフォルトではbytes-per-inode ratio16384 と定義されます。/etc/mke2fs.conf

ドライブを直接分割するオプションがないと、残念ながらinodeの数を変更することはできません。

おすすめ記事