2

I am searching for a best practice for my use case. I have setup a vServer with following partitions:

/dev/vda1            2048     1953791      975872   82  Linux Swap / Solaris
/dev/vda2   *     1953792    16775167     7410688   83  Linux
/dev/vda3        16775168   245366719   114295776   83  Linux

/dev/vda2 and /dev/vda3 are partitioned with ext4. On /dev/vda2 is the root partition. The vServer will be used mainly for Websites (nginx, mysql, php, ...).

My question is how to use the /dev/vda3partition?

One idea I have, is to mount it to e.g. /mnt/vda3, create different folders (home, var, opt, srv, ...) and symlink them to the according places in the root filesystem?

Or should I better create different partitions for the mentioned folders and mount it to the root partition? What are good values for the partition sizes then?

Or is there a best practice for this use case?

Georg Leber
  • 135
  • 1
  • 5
  • See also http://askubuntu.com/questions/379008/creating-multiple-partitions, http://askubuntu.com/questions/516353/what-are-the-advantages-and-disadvantages-of-mounting-various-directories-on-sep, http://askubuntu.com/questions/379205/installing-programs-in-root-vs-home-partitions – Rmano May 19 '15 at 08:16

1 Answers1

2

The best practice is related to needs.

for example If I want to keep my user data and i consider those data are much valuable then i'll make my home on different partition.

here in your case, since you have only one empty partition to be assigned so you have to make a choose.

What's most important for you, the users data or the services data (mysql-nginx-...) , so either make your home on the third partition or assign it for /var according to your definition of how much this data is valuable.

For me, I prefer to assign /var.

So in simple words nobody can answers you what is the best in general, you have to choose what is most valuable for you to keep it save..

Maythux
  • 84,289
  • I understand. Let's say, the services data is important for me. Would you mount the complete partition to /var? I have concerns, that the current size of the root partition will not last for the whole bunch of installations. – Georg Leber May 19 '15 at 07:43
  • 1
    yes i would assign the whole partition for /var, but you have to keep in mind since home will be under root then you probably should resize the root partition, and make it bigger. – Maythux May 19 '15 at 07:46
  • @Develman You are welcome friend. Have good time – Maythux May 19 '15 at 07:52
  • I wouldn't say the critical factor in this case is not what's more important, but rather what requires more space. This example's /dev/vda3 is much bigger than the other partitions -- 109GiB vs. 7GiB for /dev/sda2. If /var will hold lots of data, then by all means, use /dev/vda3 for it; but if /home will hold more data, mount /dev/vda3 there. Incidentally, 7GiB is pretty small for an Ubuntu installation. It may be adequate, but personally, I think I'd start over and give two or three times that much space to Ubuntu. – Rod Smith May 19 '15 at 13:21