Gentoo Archives: gentoo-user

From: Tanstaafl <tanstaafl@×××××××××××.org>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Partition layout questions - WAS Re: Best filesystem for virtualized gentoo mail server - WAS: vmWare HowTo / best practices
Date: Sun, 21 Apr 2013 16:54:30
Message-Id: 517419A2.6090706@libertytrek.org
In Reply to: [gentoo-user] Best filesystem for virtualized gentoo mail server - WAS: vmWare HowTo / best practices by Tanstaafl
1 Next, as to partition layout.
2
3 I was considering this partition layout:
4
5 /boot (ext2), 100M
6 /swap, 2048G
7 / (ext4), 40G
8 /tmp (ext2), 2G
9 /var (xfs), 600G
10
11 But doing some reading, I stumbled on some other suggestions, like:
12
13 Bind /tmp to tmpfs, ie:
14
15 tmpfs /tmp tmpfs nodev,nosuid 0 0
16
17 Then I read another suggestion to bind /var/tmp to /tmp:
18
19 /tmp /var/tmp none rw,noexec,nosuid,nodev,bind 0 0
20
21 Which means that both /tmp and /var/tmp are now bound to /tmp?
22
23 But, I also read one one of these pages that tmpfs should NOT be used
24 for /var/tmp, because it stores files that need to be persistent across
25 reboots - is this still true?
26
27 My main concerns are security (which dirs should be separate so they can
28 be mounted as securely as possible, is, nodev noexec and nosuid mount
29 options)?
30
31 1. Should I go ahead and make separate smallish (maybe 1 or 2GB) /home
32 so I can mount it nodev,noexec,nosuid?
33
34 2. Should I make a separate partition for /var/tmp so I can mount it as
35 nodev,noexec,nosuid, and bind /tmp to /tmpfs as above? Or does the
36 caveat about /var/tmp storing files that need to be persistent across
37 reboots no longer apply, and I can bind them both to tmpfs?
38
39 3. Dumb question (google didn't give me an answer) - can I mount all of
40 /var noexec and nosuid? Assuming not...
41
42 4. Since I'm running dovecot with a single user (vmail), and dovecot
43 stores sieve scripts in the users 'home' dir, does this mean I can't
44 mount that directory with nodev noexec and/or nosuid?
45
46 5. Webapps... can I mount the dir where these are installed with
47 nodev,noexec,nosuid (I still use webapp-config to manage my website
48 installations, and currently these are in /var/www)?
49
50 I'm thinking an alternative would be to put all data that can be stored
51 on a partition that is mounted nodev,noexec,nosuid, ie:
52
53 /virtual
54
55 which would contain:
56
57 /virtual/home
58 /virtual/mail
59 /virtual/www
60
61 Maybe I'm overthinking/overcomplicating this, but obviously now is the
62 time to make these decisions...
63
64 So, comments/criticisms welcome as always...