Do I need to separate /var and /tmp from the root partition on AWS EC2?

A result of an audit check on the Amazon Linux AMI gave a number of recommendations on the file structure, for example the need to have the root and /var and /tmp on different partitions.

Is this still advisable practices in the public cloud world or hang over from on-prem hardware and VM infrastructure?


Solution 1:

It depends on what you are doing.

Traditionally, /var and /tmp are separate because that is what gets written to regularly, and if a runaway process generates lots of output, this fills up only one of the less important partitions, so while services may become unavailable (and should gracefully bow out and return temporary error codes), interactive logons still work so one can log in and investigate.

In addition, it means that when /var becomes more and more fragmented as files of different sizes are created and deleted, that doesn't spill over to the root partition.

If you are working with lots of small files, a different blocks-to-inodes ratio on /var might also make sense.

If either of these is a concern for you, the split still makes sense, otherwise not so much.