An ext4 partition mounted on /var/mqueue routinely stores millions of 512-byte e-mail queue files. After several days of heavy load, new messages cannot be queued and the touch command returns "No space left on device" even though disk blocks are still available:
$ df -h /var/mqueue Filesystem Size Used Avail Use% Mounted on /dev/sdb1 20G 8.1G 10G 45% /var/mqueue
You plan to recreate the filesystem so it can hold at least four times as many small queue files before running out of inodes. Which mkfs.ext4 command option should you adjust to achieve this without adding more storage?
Format the partition with mkfs.ext4 -i 1024 /dev/sdb1 to decrease the bytes-per-inode ratio.
Format the partition with mkfs.ext4 -J size=400M /dev/sdb1 to enlarge the journal.
Format the partition with mkfs.ext4 -t largefile4 /dev/sdb1 for a large-file usage profile.
Format the partition with mkfs.ext4 -m 0 /dev/sdb1 to eliminate reserved blocks.
The number of inodes in an ext4 filesystem is fixed when the filesystem is created. It is controlled by the bytes-per-inode ratio, set with the -i option to mkfs.ext4. Lowering this ratio (for example, mkfs.ext4 -i 1024 /dev/sdb1) allocates many more inodes, letting the partition store far more tiny files before inode exhaustion occurs. The -m option only changes the percentage of space reserved for root and does not affect inode count. -J size=… alters journal size, not inodes. The usage profile chosen with -t largefile4 is optimized for very large files and actually reduces the number of inodes, making the problem worse.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the -i option in mkfs.ext4 do?
Open an interactive chat with Bash
Why does running out of inodes cause a 'No space left on device' error?
Open an interactive chat with Bash
How does the mkfs.ext4 -t largefile4 option affect inode allocation?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access