1

I am setting up a new Linux Ubuntu server on Amazon EC2 and wanted to create a few extra volumes, to be mounted without execute permissions.

  • /tmp for temporary files
  • /var so that log files and mysql DBs have their own disk
  • /var/www for websites

Now /var/www would be mounted within /var I wonder if that is a problem, since also /var is a mounted volume, or is a normal thing to do?

Also are /etc/fstab volumes mounted from top to bottom, and in that case should I put /var first and /var/www after?

stivlo
  • 739
  • 3
  • 10
  • 24

2 Answers2

5

According to the fstab manual:

The order of records in fstab is important because fsck(8), mount(8),
and umount(8) sequentially iterate through fstab doing their thing.

So yes, lines in the beginning got processed first, so put /var before /var/www. As to the second question: you can safely mount filesystems within a mounted one, it will work.

Lacek
  • 6,585
  • 22
  • 28
2

There's no reason why you can't do this, really.

Bear in mind that normally, / is just /dev/sda1 or wherever, and you can mount whatever you like under /, such as /home as a NFS mount.

Remember that you can also change where MySQL stores it's files, so they're not in the default /var/lib/mysql, ditto /var/www.

Personally, /var/www makes a lot less sense to me than /srv/<sitename>

Tom O'Connor
  • 27,440
  • 10
  • 72
  • 148