What size should my partitions be?

I’ve spent the last few days searching for an answer regarding partitions but either the information is old or doesn’t seem to fit my situation. I apologize if I overlooked something, but I would appreciate any help I could get. (I am more of a programmer than a sys admin person.)

I have the following hardware: 4GB RAM, 2 250GB hard drives in Raid 1 mode (motherboard based), 4 650GB hard drives in Raid 5 (hardware controller based).

I will be running apache and mysql. I suspect that the database will be rather large and I will use this server to store lots of pictures. I also would like to run Virtualbox so I can install Windows for those occasions that I still really need Windows programs.

I am thinking I want the following partitions:

swap (on Raid 1)
/boot (on Raid 1)
/(root) (on Raid 1)
/var (keep logs, etc. separate from rest of OS) (on Raid 1)
/usr (for my applications) (I think on Raid 1)
/home (for virtualbox and any of my personal files) (on Raid 5)
/data (for mysql and all my pictures and those of family/friends) (on Raid 5)

I would very much appreciate any feedback as to what partitions I should create, which physical drives to put them on and particularly how large they should be.

Thank you in advance!

I see no reason to separate /usr from /. I also doubt if you need to RAID swap, you could just make both partitions swapspace. Since you have 4G RAM, you would seldom need swap anyway. Other than that you’ve more or less answered your own questions.

The whole drive is in Raid 1 so it would be difficult to separate out the swap. I thought about separating /usr from / if I want to reinstall the OS and don’t want to reinstall all the applications (at least those in (/usr/local).

Thanks for your input.

It would make more sense to separate out /usr/local then. When you upgrade, pretty much everything under / except for /home and /usr/local is affected. Another thing you might want to separate out is /opt, or you could point this to somewhere in /usr/local. Or make a separate partition and point /usr/local and /opt to parts of it.

When is /opt used versus /usr/local?
So I assume you can’t leave /usr intact when you reinstall if it is on a separate partition? (Or there just is no reason to.)

Any suggestion on partition sizes for /boot, /, /var, /usr/local or /opt given my available space?

Thank you so much!

Not hard and fast. LSB says /opt for vendor packages and /usr/local for local software, but those definitions are loose.

/opt tends to be used for entire subsystems, e.g. kde3 was put there initially but now kde4 is integrated with the normal places. I put things that are a world unto itself there, like say LTSP, or a Sun Java release, or something like Alfresco or Zimbra, something that came from a vendor, things that have subdirectories like bin, lib and so forth which would look a little odd in /usr/local/<package>, especially as /usr/local already has subdirectories of bin, lib, etc.

I tend to put locally compiled programs in /usr/local as it’s easy to do with --prefix=/usr/local to GNU configure.

If you look at the contents of a typical RPM, you will find things in /etc, things in /usr/bln, /usr/lib, /var/lib and so forth. So /usr is not easily separated from /.

/boot 100MB (generous)
/var 10GB (plenty of room for logs and large spool files)
/ 20-30GB (generous but gives you lots of wiggle room if you want multiple DEs)
/usr/local + /opt everything else

/home vs /data split is up to you

MySQL data goes into /var/lib/mysql but it’s easy to make that a symlink to somewhere in /data

If the RAID 1 array is at the drive level, there is effectively a single array. What advantage do you then gain putting the OS directories in separate partitions? Keeping /var separate is often done on servers, but there /var is on its own disk. There is some logical separation between /opt and /usr, but as @ken indicated, the OS is pretty much an integrated whole and usually needs to be managed as such. If you are cutting your own independent code, then yes, a separate /usr/local is useful for manageability. There can be an advantage to having /boot separate, but that doesn’t appear to be applicable here. And of course, putting swap in the array gains nothing, but you have no choice; with 4GB of RAM, probably won’t matter anyway.

What you’re doing with the RAID 5 looks like a good enough approach, although I would put the database on its own partition with a symlink back to /var/lib. I assume you’re aware of the write performance penalty inherent in RAID 5; of course the hardware controller offsets some of that (although a high volume of writes against a database can create a bottleneck due to the parity handling).

On 2008-10-09, daniel92 <daniel92@no-mx.forums.opensuse.org> wrote:

> When is /opt used versus /usr/local?
> So I assume you can’t leave /usr intact when you reinstall if it is on
> a separate partition? (Or there just is no reason to.)
>
> Any suggestion on partition sizes for /boot, /, /var, /usr/local or
> /opt given my available space?

Is there a point in creating so many separate partitions, these days ?
The days of running a mainframe on 8 KB of RAM and creating microscopic
partitions are well behind us.

I’d create / on raid 1 and /home on raid 5. Consider a 2 GB swap, but with 4
GB of RAM, why bother ?

(Prepare for the storm of outbursts of ‘blasphemy!’ that will now follow,
and try to find a valid argument in it. Good luck)


Elevators smell different to midgets

I appreciate all the responses. Thank you!

I guess my reason for multiple partitions is that the box will act as a server and I don’t want /var filling up / and I want /data and /home separate for manageability.

I will have a hard time knowing in advance how much room I need in /usr/local versus /opt. I guess I can’t really put them on the same partition, correct? (I will be doing a fair amount of coding and thus want a separate partition /usr/local).

What is the benefit of having the database on a partition separate from the data? My concern is that I don’t know how large the database will grow at this point.

I am aware of the write penalty in RAID 5 but unfortunately it’s a question of money. I want some redundancy but something like a RAID 10 is a bit costly.

When is having a /boot partition applicable if not in this case?

I indicated an easy out, just make a partition called say /local and then make links for /usr/local to /local/local and /opt to /local/opt.

What is the benefit of having the database on a partition separate from the data? My concern is that I don’t know how large the database will grow at this point.

Database intensive sites will want more control over the characteristics of where they store the data. This is probably not you.

When is having a /boot partition applicable if not in this case?

In the bad old days, BIOSes could not access beyond a cylinder limit so /boot was put at the beginning of the disk.

It’s also debatable whether you need a separate /var. Sites that do this are like sayISP mail spool machines where they do not want a full /var to cause the OS to crash.

If I were you this is what I would do for the first array:

/ (including /boot, /usr and /var)
/local (for /usr/local and /opt)

This means you can upgrade or replace the OS without touching local mods. For the second array, maybe:

/home
/data (with /var/lib/mysql linked here)

But it’s also debatable whether you need a separate /home and /data. You could create data under say /home/data. One advantage of separate partitions might be that they will be easier to separate for backups (if doing full disk backups), otherwise separation by explicit naming or exclude clauses can do that.

As for lots of partitions, the OP has heaps of space. The danger of too many partitions is that space gets fragmented and one partition runs out while there is still a lot of free space overall. The partition table is a non-issue, you can make as many logical partitions as you need. If it were a budget user with only a 80GB disk, I would say just have / and /home.

I agree with @ken_yap’s suggestions. My thought re a separate partition for the database was precisely for manageability. Separating the RAID 5 for /home and /data may do the same, but if that’s not important, then no point in having diff partitions.

On Thu October 9 2008 09:16 pm, mingus725 wrote:

>
> I agree with @ken_yap’s suggestions. My thought re a separate partition
> for the database was precisely for manageability. Separating the RAID 5
> for /home and /data may do the same, but if that’s not important, then
> no point in having diff partitions.
>
>
There is some reason to to keep /var on a separate partition with OpenSuse
depending on the services you plan to run. A number of services keep critical
files in /var/lib that would need to be restored when upgrading(, which you
will need to do every two years or so.) In particular these two come to mind;
Bind has its’ zone files in /var/lib/named and Samba a number of its’ .tdb
files in /var/lib/samba. In any event you need to have some place to stash
these files when you perform an upgrade so that they can be easily restored.

P. V.
Cogito cogito ergo cogito sum.

Thank you everyone for all your responses. This has been very helpful. I’ve been struggling with this for a while and I am glad that this forum is so responsive. I very much appreciate it.