Jump to content
  • 0

Linux - Partition Advice Needed


Unkle Nuke

Question

I have my server fixed, but I've reached a point in my thinking that I want to ditch Windows completely. I shall dual-boot no more!

My server box has three hard drives, 250 GB, 100 GB, and 80 GB. When it's not being used for my personal MaNGOS server, the system will be primarily a developer environment, C++ and whatever, using Git and Subversion to pull and manage MaNGOS and other interesting repos. I also plan to tinker around with WINE and try a few Linux games, too. I may eventually establish an Apache server, to try out some of the nifty MaNGOS web tools and Shlainn's Wow.js, so a bit of web development may creep in.

Keep in mind, as you read further, that my server is on a LAN that has just one user, me.

It appears that modern Linux distros follow Microsoft's idea of "user-friendly", defaulting to either a monolithic build or using just three partitions for root, home, and swap. I would prefer a more flexible, safer, and secure multi-partition configuration used by traditional Unix and Linux installations.

Where I have stumbled is in deciding just which partitions I need and how much space to allocate for each. The various guides I've read elsewhere are either too vague or hopelessly outdated. Some say 10 GB is plenty for root while others claim 50 GB or more is essential.

I get that /home is going to be the largest, being where I would install my software, games, and store my files and downloads, but then what is /usr and /opt for if /home is where everything goes?

Then there is /var and /srv. Some guides say web server files and databases belong in /var, but others tell you anything to do with a server, like web or FTP, belongs in /srv.

Can all you MaNGOS resident Linux users offer some ideas on which parts of the filesys should have their own partitions and how much space should be allocated? Feel free to share your own server's partition scheme as examples, so I may get an expectation of what I may need to implement.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

i'm using CentOs as a linux box. because i'm using it mostly as a virtual machine so i'm not changing partition layout. but earlier i used to split it into something like this:

/ /home /opt /ust /var /swap

10G for root partition is enough (if! you place /opt partition is separate place).

/home 1/5 of all disc space sometimes more/

/opt well, when you use chrome browser, it will be placed here. i also put in here mangos server. 20-30G should be fine for quite long time

/usr if you are planning to use linux a lot, 100-150G might work for a while (if you want to be fully secured, use whole disk for it -

250G's ;-) )

/var it depends, you are saying about web server, so probably there also will be db, after a while, there will be also planty of logs. 20-50G's

/swap 2-3 times RAM

some software requires quite big /tmp partition (like oracle db) so you might cut some place for it too (or just adjust size of root partition)

Link to comment
Share on other sites

I've been using Linux as the only operating system at home for the last 10 years now, and if there's one thing I've learned in all those years it's this: there is no such thing as THE solution. My situation is most likely different from yours, and vice versa. So keep the following in mind: "Your machine, your rules."

That said, we can of course share our personal view. First, the big difference you find for root's size (10 GB or 50+ GB) probably comes from the fact that you can choose to put /usr on a separate partition, or not. If /usr is a different partition, most of your system software is not in your root partition, so I can imagine that 10 GB is enough then. Otherwise, at least 50 sounds reasonable indeed.

Personally, I'm not a huge fan of a plethora of partitions for a personal system, because in my experience there is no real benefit of creating a dozen partitions for everything (/, /home, /opt, /usr, /boot, etc). In most home systems, they all end up on the same harddisk anyway, and if it dies you loose all partitions, period. So what I typically do is create 4 partitions.

First, the root system. It contains what I call system software (think 'system installation' and the packages your favorite package manager installs for you). It includes /opt, /bin, /usr, /lib, /boot, /var etc as subfolders. The idea is that, apart from some configuration or log files maybe, this data is "worthless" (so no user data!). If the disk dies, you can reinstall the system. Since all software is installed on it, 10 GB won't cut it and the 50 GB you've found sounds reasonable. In your case, a good chunk of the 100 GB disk seems an option (or even the entire disk).

Then, the swap partition. I know that many recommend "a few times the size of your memory", but I usually stick to a fixed size of around 10 GB. If the machine doesn't have a lot of memory, this is indeed "a few times" its size. If it has lots of memory (say 8 GB or more), it shouldn't swap a lot for starters! I've never seen my machines use more than a few GB of swap really, and then I'm already pushing it.

Then, the /home partition. Speaks for itself really, and this is "user data", so important (backup for anything you can't loose!). Since all your data is going to be put on it, a large disk. A few games, source trees, some music, some videos etc and it adds up quickly. In your case, I'd use the 250 GB disk for that.

And last, I typically create a "server data" partition, /srv. This is where I create subfolders for the services and servers I run. I put my MySQL data there, the files my Apache serves, the data of the mailserver, etc. Again, typically important data, so provide backup. The size depends on what you plan to do of course. A small "just for me" machine won't typically need more than a few dozen GB of diskspace. Even a few dozen databases and some website related data is not taking that much. The 80 GB disk comes to mind.

In summary, and assuming you have other means of backup (ie you don't copy files from say the 100 GB disk to the 80 GB disk as some sort of lame 'I still have a copy if the disk dies' backup), this is what *I* would do:

100 GB disk => /

80 GB disk => about 10 GB swap, rest /srv

250 GB disk => /home

But, keep in mind what I said. It's your machine, so your rules!

Link to comment
Share on other sites

Thank you both for sharing your insights and wisdom. Your two posts have helped me far more than slogging through a hundred pages of Google hits! :)

I was feeling somewhat masochistic, this morning, so I trawled through about 100 more pages of Google search results for more information. It only left me with more questions. :/

It seems many of the Ubuntu-based distros, and some others, requires /usr to be inside root and discourages mounting it to its own partition. The only reason I could find was rather non-specific, stating that some directories needed by the kernel are located in /usr.

I take it this means /usr is the equivalent of \\windows\\system32\\ ? It also appears that /opt is used for system-wide software that is installed from the distro packages, such as Vim or snort, right? This makes /opt similar to \\windows? Would that then mean other programs that are user-specific, like a web browser or game, belong in /home? So home would be equivalent to \\Program Files?

These partitioning and filesys guides don't really go into much useful detail to identify which directories are usually used for system executables, system software, user programs, and so on. While nearly all assume you're setting up a dual-boot Windows/Linux system, going into great detail about resizing partitions to make room for Linux, none of the authors bother to give users an idea of the Windows filesys equivalents for each Linux directory. :rolleyes:

I have simply been sticking everything I use in /home, but I want to change this with a more proper configuration, now that my computer will be a full-time Linux box.

Link to comment
Share on other sites

It seems many of the Ubuntu-based distros, and some others, requires /usr to be inside root and discourages mounting it to its own partition. The only reason I could find was rather non-specific, stating that some directories needed by the kernel are located in /usr.

I'm not sure why Ubuntu-based distros need /usr under root, but who knows if they put a few binaries in /usr/sbin or /usr/bin that are needed when they run scripts before the filesystems are mounted? I would expect those binaries in /sbin then, so this is only a wild guess. The root filesystem is mounted by the kernel, so if /usr is not on a separate partition, those tools can be found and used. If it is on a separate filesystem, obviously that has to be mounted first before the tools on it can be executed... and if those tools are required to mount filesystems... well, chicken and egg problem :P

Again, I'm just guessing. I don't know the real reason, since I've never used Ubuntu on my systems :)

I take it this means /usr is the equivalent of \\windows\\system32\\ ? It also appears that /opt is used for system-wide software that is installed from the distro packages, such as Vim or snort, right? This makes /opt similar to \\windows? Would that then mean other programs that are user-specific, like a web browser or game, belong in /home? So home would be equivalent to \\Program Files?

I don't think there is a direct mapping between those folders and the folders on a typical Windows system; /usr is typically "shared, read-only data, meant to be shared between (compliant) hosts". The \\windows\\system32 analogy isn't completely accurate, but a good start I guess. The /usr/bin subfolder contains most user commands, /usr/lib most libraries... and on Windows those are typically in \\windows\\system32.

The /opt folder is for "add-on application software packages", typically larger software packages. One of the often used rules is that creating your own subdirectories in /usr is a big no-no. But large applications (like OpenOffice or so) contain so many files these days that it makes sense for them to have their own subfolders. So distributions tend to put those applications in their own folder in /opt, where they are free to create whatever folders they wish. I'd say that roughly maps to the Program Files folder, while /home is roughly your own Documents and Settings folder. Web browsers are typically installed in /usr (or /opt), and not in /home, because they are useful for every user on the system. But the preferences and data (cookies, temp files) are user specific, so those files would end up in /home (just like IE's temp files would end up in your down Documents And Settings). But suppose that you want a web browser that's not installed on the system, and your admin refuses to install it, then you would install it for yourself only somewhere in /home. Less relevant for the typical home machine of course, since you are typically the admin too :P

These partitioning and filesys guides don't really go into much useful detail to identify which directories are usually used for system executables, system software, user programs, and so on. While nearly all assume you're setting up a dual-boot Windows/Linux system, going into great detail about resizing partitions to make room for Linux, none of the authors bother to give users an idea of the Windows filesys equivalents for each Linux directory. :rolleyes:

I think the reason for that is twofold. First, it's hard to give a good one to one mapping. The philosophy is slightly different, so there is no simple list of "A on Windows is B on Linux (or vice versa)". And the second reason is that different Linux distributions/systems sometimes do different things. Back in the days when I started with Linux, even different Linux systems weren't consistent about what to put where, so go figure! Though I believe that's changed nowadays, and there is some kind of consensus in the form of FHS. So that might be a good start to get an idea of what goes where and the philosophy behind it. See http://www.pathname.com/fhs/pub/fhs-2.3.html :)

Link to comment
Share on other sites

Thank you very much for that link, evil! :)

The description of the POSIX filesys standard was far more helpful than all the guides Google managed to find. It's now a permanent and prominent addition to my Unix/Linux library.

That document is clear and to the point, giving me a much clearer idea of what goes where in a standard Linux installation. My attempt to correlate the Windows file system to Linux was intended more as a mental construct, relying on my "native" language of Windows to understand Linux. As with translating human language, I was trying to find meaning in context, rather than literal definition. Your own observations on this helped me to grasp the differences between generally used software (/opt) and personal programs and files (/home).

Originally, I wanted to go with a true Unix. I still have my registered copy of Solaris, which I obtained as a free offer to members of the Sun Developers Network. Unfortunately, it seems Oracle pretty much killed Solaris as an open source platform. It's too bad I didn't have a spare PC back when I got my Solaris DVDs.

I have settled on Debian as my Linux. Although it's considered more conservative than newer distros, I feel Debian is the best choice for POSIX compliance, adherance to open source, and the largest amount of software. I have the full distro, on eight DVDs, so I can do an offline installation. It's probably just as well I never got into Solaris. Debian is unlikely to be discontinued and lose support anytime soon, plus the GPL and similar OSI licenses are much less restrictive than my Solaris license, which is has some proprietary and third-party pitfalls.

Thanks to the very capable and intelligent community we have here, all I need to do now is plan out my partitioning scheme, though most of the work on that has already been done by both of you, evil@wow and kupix! :D

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use