I will be using a Ubuntu server install as a server for a MySQL database. Is there any benefit to having /var
in a separate partition from the root file system?
I will be using a Ubuntu server install as a server for a MySQL database. Is there any benefit to having /var
in a separate partition from the root file system?
I always have /var
on a separate partition and never had problems with it. Doing it this way prevents a misbehaving application (like your database server, but also log files in /var/log
) from eating up all the space on the disk. Of course it also works the other way around. If someone (or some program) decides to write enormous files in /tmp
this would affect your database as well if /tmp
and /var
reside on the same partition.
If you plan on putting parts of your directory hierarchy on different partitions I would suggest to take a look at LVM (the Logical Volume Manager). LVM allows you to dynamically extend your 'partitions' (called Logical Volumes or LVs in LVM parlance). This means that if your LV containing /var/
is almost full you can extend it, grow the file system on the fly and continue without any interruption to your database.