Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
    
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 '11 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 '11 at 11:30
2  
Oh, I see. It sounded like you had a partition where -only- /tmp and /var resided. –  user606723 Aug 19 '11 at 17:10

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

share|improve this answer

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.

share|improve this answer
    
While this may be a valid consideration, it just adds confusion and is not relevant to the context of the question. –  cr8ivecodesmith Sep 18 '13 at 4:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.