![]() This syntax works in bash and zsh, but it will not work in fish. # tune2fs -l /dev/ device | grep 'Block size:' Block size: 4096 This is almost always 4096, but you can check to be sure: # tune2fs -r $(( ngigs * 1024**3 / blocksize)) /dev/ deviceīlocksize is the block size of the filesystem in bytes. To set the number of reserved block space to an absolute size in gigabytes, use -r: To totally prevent reserving blocks upon filesystem creation, use: The -m option of ext4-related utilities allows to specify the percentage of reserved blocks. Used as long-term archive, i.e., where files will not be deleted and created very often. ![]() It is generally safe to reduce the percentage of reserved blocks to free up disk space when the partition is either: See this email for the opinion of ext4 developer Ted Ts'o on reserved blocks and this superuser answer for general background on this topic. Reserved blocksīy default, 5% of the filesystem blocks will be reserved for the super-user, to avoid fragmentation and " allow root-owned daemons to continue to function correctly after non-privileged processes are prevented from writing to the filesystem" (from mke2fs(8)).įor modern high-capacity disks, this is higher than necessary if the partition is used as a long-term archive or not crucial to system operations (like /home). Warning: If you make a heavy use of symbolic links, make sure to keep the inode count high enough with a low bytes-per-inode ratio, because while not taking more space every new symbolic link consumes one new inode and therefore the filesystem may run out of them quickly. use -i 2097152 for a 2 MiB ratio and -i 6291456 for a 6 MiB ratio. The bytes-per-inode ratio can also be set directly via the -i option: e.g. Among those types are the bigger largefile and largefile4 which offer more relevant ratios of one inode every 1 MiB and 4 MiB respectively. To specify a different bytes-per-inode ratio, you can use the -T usage-type option which hints at the expected usage of the filesystem using types defined in /etc/nf. $ df -hi /home Filesystem Inodes IUsed IFree IUse% Mounted on $ df -h /home Filesystem Size Used Avail Use% Mounted on This situation can be evaluated by comparing the Use% and IUse% figures provided by df and df -i: 256 * several millions = quite a few gigabytes wasted in unused inodes. This results in a waste of disk space, because all those unused inodes each take up 256 bytes on the filesystem (this is also set in /etc/nf but should not be changed). However, for partitions with size in the hundreds or thousands of GB and average file size in the megabyte range, this usually results in a much too large inode number because the number of files created never reaches the number of inodes. If the inode count is too low, no file can be created on the filesystem even though there is still space left on it.īecause it is not possible to change either the bytes-per-inode ratio or the inode count after the filesystem is created, mkfs.ext4 uses by default a rather low ratio of one inode every 16384 bytes (16 KiB) to avoid this situation. The larger the bytes-per-inode ratio, the fewer inodes will be created.Ĭreating a new file, directory, symlink etc. Mke2fs creates an inode for every bytes-per-inode bytes of space on the disk. ![]() ![]() If supported, you may want to enable metadata checksums.See mke2fs(8) for more options edit /etc/nf to view/configure default options. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |