Partitioning and Quotas

I was wondering how people typically partition their servers. I typically see schemes which separate the /home, /var and /tmp directories into separate partitions. I've been fortunate so far in that the linux boxes I've set up in the past are plentiful on space but now that I'm limited to 2GB, I was wondering what people might recommend. I'm planning on using Debian. This will be a standard webhost with apache, mysql and mail.

Here's what I'm thinking

swap - 128M

/ - 500M

/var - 500M

/home - the rest where web directories and mail should be stored

Since there doesn't seem to be much discussion on this that I can find here, do people bother with this? If not how do you keep a user or DoS attack from filling up the drive and rendering the system useless?

3 Replies

It very much depends on where you want to install things.

For example I use custom directories for my data and logs, which are passed off the root /

It is done for two reasons, so that things are easy to find and so that they can be placed on to seperate HDs if nessecary.

As for HDs filling up, you should monitor this carfully as if you where to place your logs on a seperate partition and that was to get full, you would have problems.

Since you can re-size partitions, the inital size should not be a problem, start off small.

I can fit a full debian set-up with apache, mysql, perl, php etc, it does not have mail on, but it does have samba as it is a dev box in under 700 meg, with all custom install stuff in /usr/local

/var is about 64 meg

/usr is about 435 meg

Adam

This is one of those things that really depends on what you are doing …

I install all my software (apache, mysql, email, etc) in /usr/local … and yet at the same time all the real important files (HTML, databases, Maildirs, etc) are kept in /home.

My reason for this is simple: When my distro screws up I can simply wipe / and nothing ever happens to /home

(I also do NOT keep a seperate /var partition because I have nothing of little importance there, and I dislike keeping logs because then I would conform to the PATRIOT/Big-Brother act of the USA. Do note that by not keeping a seperate /var I open myself to loging DoS)

Filesystem            Size  Used Avail Use% Mounted on
/dev/ubda             582M  375M  177M  68% /
/dev/ubdc             1.3G  564M  670M  46% /home
swap                  128M

@abarilla:

I was wondering how people typically partition their servers. I typically see schemes which separate the /home, /var and /tmp directories into separate partitions. I've been fortunate so far in that the linux boxes I've set up in the past are plentiful on space but now that I'm limited to 2GB, I was wondering what people might recommend. I'm planning on using Debian. This will be a standard webhost with apache, mysql and mail.

Here's what I'm thinking

swap - 128M

/ - 500M

/var - 500M

/home - the rest where web directories and mail should be stored

Since there doesn't seem to be much discussion on this that I can find here, do people bother with this? If not how do you keep a user or DoS attack from filling up the drive and rendering the system useless?

I started out building my systems with separate /, /usr, and /data partitions. I liked to put /usr on a separate partition with the idea that I would mount it read-only, so as to ensure that no software was ever corrupted accidentally, but I never actually did this. I put all of my home directories, and any other important data, in /data. The idea behind this was to keep everything that I would want to back up in a separate partition, and just back that partition up. When I was using a CD-RW drive to do backups, I would make more than one /data partition (/data, /data2, /data3, etc) all of which were only 600 MB, to ensure that each could be backed up completely to one CD-RW. Needless to say, this led to alot of headaches managing disk space on many small partitions.

When I made my Linode, I did away with all of this complicated stuff. Now I have just two partitions:

swap

/

That's it. I use 384 MB of swap, and all of the rest of my space goes into my one root partition. I honestly never got much out of keeping things in separate partitions. People say that it's "safer", in that the kernel will less likely screw up data all over the disk if it has bugs, but would be confined to screwing up whatever partition it was writing in at the time. I have been using Linux for nearly 10 years and have never actually gotten any benefit out of this. Linux has never screwed up any of my filesystems, and now with ext3, fsck times are fast and so even on a crash it doesn't take long to boot back up.

So what I am saying is, there are reasons for using separate partitions, but in my experience, none of them has proven particularly compelling. So for simplicity's sake, I use one single partition for all of my files.

Obviously, if you wanted to test different filesystems, or if you had specific needs for specific services (like a news server which would write tons and tons of little files and so needed a differently-optimized filesystem), you'd have more of a reason to use separate partitions. But if you're just doing general-purpose stuff, I think one big partition is just fine.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct