Design a server where logs and queues may grow rapidly.
Limit the impact on the root filesystem if they consume their allocation.
Which directory is the best separation candidate?
/var contains logs, spools, and caches. A separate filesystem can contain their growth, alongside monitoring and rotation.
Detailed explanation
/usrIncorrect. /usr mainly holds shared programs and read-mostly data.
Incorrect. /usr mainly holds shared programs and read-mostly data.
/bootIncorrect. /boot stores boot files, not growing logs and queues.
Incorrect. /boot stores boot files, not growing logs and queues.
/varCorrect. /var is the main location for logs, spools, and caches.
Correct. /var is the main location for logs, spools, and caches.
/etcIncorrect. /etc stores configuration rather than variable log data.
Incorrect. /etc stores configuration rather than variable log data.
Try it yourself
An example you can run in a temporary verification environment.
du -sh /var/log /var/cache 2>/dev/null | sed -n '1,4p'Expected result
/var配下の可変データ使用量。環境により値は異なるKey points
- /var stores variable data
- Capacity exhaustion can be isolated
- Monitoring and rotation still matter
Notes
- Environment: FHSに沿うLinux / 読み取り確認
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.