특정 수의 inode로 Linode를 설정하는 방법은 무엇입니까?

특정 수의 inode로 Linode를 설정하는 방법은 무엇입니까?

일반적으로 사람들은 Linode를 만들 때 계획을 선택하고 Linux 배포판을 배포하고 할당할 디스크 양을 선택합니다. 일반적으로 스왑 파티션과 기본 파티션이 있습니다.

하지만 일단 그렇게 하면 파일 시스템이 특정 수의 inode를 생성하게 됩니다! 그렇다면 특정 수의 inode를 사용하여 Linode(Ubuntu 12.04 KTS)를 설정하는 방법은 무엇입니까?

나는 리눅스 파일 시스템에 대해 잘 모른다.

답변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 수를 변경할 수 없습니다.

관련 정보