3

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?

1

3 Answers 3

3

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.

3
  • How would /tmp and /var exist on the same partition? They would be symlinks to a different mount point for that partition... or can you actually add two entries into fstab specifying a specific directory in a partition to mount.
    – user606723
    Aug 14, 2011 at 21:59
  • /tmp and /var are always on the same partition (namely the one / is on) unless you specify either of them is on a separate partition. For example, if you decide to only have two partitions, e.g. / and /home then /tmp and /var are on the same partition.
    – ph0t0nix
    Aug 19, 2011 at 11:30
  • 2
    Oh, I see. It sounded like you had a partition where -only- /tmp and /var resided.
    – user606723
    Aug 19, 2011 at 17:10
3

I've tried to run one of my natty servers with a separate /var a couple of weeks before - it just doesn't start. There seems to be a pretty long history of Ubuntu having various problems with /var on a separate filesystem

So, your best bet is to have some separate data partition, just not put there your entire /var

-1

You could either make a symlink or just mount the partition as /var. If you want to mount it as /var you'll need to specify that in /etc/fstab.

1
  • 1
    While this may be a valid consideration, it just adds confusion and is not relevant to the context of the question. Sep 18, 2013 at 4:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .