ext4의 일반적인 파일 시스템 할당량은 디렉토리가 아닌 사용자 / 그룹입니다. ZFS는 ZFS 볼륨에서 고정 크기의 파일 시스템을 만들어 디렉토리 할당량을 정렬 할 수 있습니다. 그러나 간단한 트릭은 2GB 파일을 작성하고 파일 시스템을 작성하여 원하는 폴더에 마운트하는 것입니다.
$ touch 2gbarea
$ truncate -s 2G 2gbarea
$ mke2fs -t ext4 -F 2gbarea
mke2fs 1.43.3 (04-Sep-2016)
Discarding device blocks: done
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: bf1b2ee8-a7df-4a57-9d05-a8b60323e2bf
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
$ sudo mount 2gbarea up
$ df -h up
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 2.0G 6.0M 1.8G 1% /home/muru/up
어쨌든 파일 시스템 할당량 (또는 이와 같은 방법)은 원하는만큼 사용자 친화적이지 않습니다. 이 방법은 온라인 에서 크기를 늘릴 수 있지만 크기를 줄이는 것이 어렵다는 점에서 단방향으로 유연 합니다.
명령 :
touch: touch 2gbarea라는 빈 파일을 만듭니다 2gbarea.
truncate: truncate는 파일 크기를 조정하는 데 사용됩니다 (이 경우 현재 비어있는 2gbarea파일의 크기 를 2GB로 조정합니다 -s 2G).
mke2fs: mke2fsext2 / 3 / 4 파일 시스템 (이 경우 ext4)을 만듭니다.
mount 주어진 디렉토리에 파일 시스템을 마운트합니다.
df 파일 시스템 사용을 나열하는 데 사용됩니다.