Web Hosting Talk







View Full Version : What partitions to set for a 19 GB drive?


pmak0
12-20-2001, 02:37 PM
Here's my thoughts on an optimal way to repartition a 19 GB hard drive for a web server:

/: 100 MB
swap: 256 MB
/usr: 3.9 GB
/var: 2 GB
/tmp: 500 MB NOSUID
/home: rest (~12 GB) NOSUID

Comments?

/usr is where MySQL is installed and I plan to put some pretty big archives in it. (Hmm, actually perhaps /usr/local/mysql/data should be moved to /home/mysql/data, in order to separate code from data? Then /usr only has to be 2 GB and I have more flexibility.)

/var is where logfiles will go. Mail goes in /home however, since I'm running qmail with Maildir delivery.

/home is where users' files go.

davidb
12-20-2001, 04:24 PM
Acually if you wanted to optimize it, you could make a partition read only, send all the superuser files there, then link em back. But seems like you got a good one, with one main exception. Honestly I have never had a server use a lot of swap space, I think im at the 10 meg mark currently. But I think they recomend you have atleast double your ram size.

pmak0
12-20-2001, 04:54 PM
> But I think they recomend you have atleast double your
> ram size.

I've heard that before too, but I never quite understood the reasoning behind it. If I have more RAM, shouldn't that mean I need *less* swap space? Unless that rule is trying to guess how much total memory I need based on the amount of RAM I have.

My machine has 512 MB of RAM, and I think 256 MB of swap space should be enough (my old server, which I am moving stuff from, is 256 MB of RAM with 512 MB of swap). Then again, I could increase the swap space to 512 MB without loosing much disk space.

clocker1996
12-20-2001, 05:58 PM
What is the difference between having it suid and not suid?
what are the disadvantages of having it no suid (for /home)

pmak0
12-20-2001, 06:08 PM
If a partition is set nosuid, then any suid or sgid bits on files in that partition will be ignored. This is for security reasons; the experts recommend that any partition where normal users can write to (/tmp and /home) be set like that.

I think this is to prevent user A from tricking user B into creating a file and chmod'ing it u+s such that user A now has control over user B's account.

priyadi
12-23-2001, 09:23 AM
What about symlinking /tmp to /home/tmp? That way you won't have to worry setting quota on both filesystems. Moving MySQL data to /home is also a good idea, especially if you want to quota the database.