A server's logs may grow rapidly.
Prevent a full log area from directly consuming all free space in the root filesystem.
Which directory is the best candidate for a separate filesystem?
/var contains logs, spools, caches, and other changing data. Separating it limits the impact of rapid growth on the root filesystem.
Detailed explanation
/varCorrect. /var is the conventional location for growing logs and other variable data.
Correct. /var is the conventional location for growing logs and other variable data.
/binIncorrect. /bin contains essential command binaries and is not the log workload.
Incorrect. /bin contains essential command binaries and is not the log workload.
/libIncorrect. /lib contains libraries needed by the system.
Incorrect. /lib contains libraries needed by the system.
/procIncorrect. /proc is a virtual kernel filesystem, not a log-storage area.
Incorrect. /proc is a virtual kernel filesystem, not a log-storage area.
Try it yourself
An example you can run in a temporary verification environment.
findmnt -no TARGET,SOURCE,FSTYPE / /var 2>/dev/null || trueExpected result
/と/varのマウント元。分離されていなければ同じルート配下として表示される場合があるKey points
- /var contains variable data
- Separate capacity failures
- Size the area for its workload
Notes
- Environment: Linux / FHS・util-linux findmnt
- 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.