Portal Home > Knowledgebase > Articles Database > Partitioning HD for CentOS
Partitioning HD for CentOS
Posted by s2000hawaii, 09-29-2008, 10:02 PM |
Aloha from Hawaii!
I need some info on how to partition my 750gb Raid 1 setup.
What size should my:
Root?
Boot?
Swap?
Usr?
tmp?
var?
I have 16gb of ram.
I have something in mind, but wanted to get your input first!
Mahalo from hawaii!
|
Posted by nikdahl, 09-30-2008, 07:30 PM |
Of course, this will depend on what the server is being used for..
Typically, I will set double the ram for swap, but I think for you, 1x ram will do. So...
swap 16gb
/boot 1gb
/var 15gb (I like putting this on a separate partition so that if something occurs - like a DOS attack - that runs the logs wild, it won't fill up the entire drive)
/ the rest
In most cases, I don't see much of an advantage to separating /usr and /tmp out, though if you are hosting users in the /home directory, you may want to partition that out (with most likely the bulk of the space)
|
Posted by s2000hawaii, 09-30-2008, 08:29 PM |
Thanks for your input!
|
Posted by net, 09-30-2008, 08:48 PM |
Moved > Technical & Security Issues.
|
Posted by copahost, 09-30-2008, 09:27 PM |
I would separate /tmp with 1GB at least.
Use it with NOEXEC ;-)
|
Posted by steveks, 10-03-2008, 02:34 AM |
One more Tip for you. A lot of servers are hacked through /tmp, using an exploit for some vulnerabitily you may have. If your /tmp isnt secure, hackers / crackers / whatever just have to upload the exploit and compile it.
In order to avoid this, you can add noexec / nosuid / nodev to your /tmp partition. The security of partitions are controled using the file /etc/fstab.
So, for example to add noexec / nosuid / nodev to /tmp, you need to do this :
1 - cp /etc/fstab /etc/fstab.copy - This will make a backup of the original file in case anything goes wrong.
2 - Using your favorite editor ( vi, pico, joe, emacs etc.. ) edit /etc/fstab file.
Find the line with /tmp partition and change it to somehting like this :
LABEL=/tmp /tmp ext3 noexec,nosuid,nodev 0 0
Your /tmp may be different, you just need to add this three options ( noexec,nosuid,nodev ). After that save the file and reboot the server.
|
Posted by albunix, 10-03-2008, 10:12 AM |
Greetings,
Before the actual partition schema can be advised, can you please let us know
what will this server be used to? In order to simply partitioning a server with dead end file system slabs, one might also look ahead and determine what will the server be used, and where would the biggest disk space would be needed, etc etc.
Things such as block-size, inode level should be kept in mind as you might find during the long run, you need to re-format in order to properly adjust some settings.
If only disk space an nothing else matters, here's my advise
/boot --> no more than 150MB only /root + kernel related files will go there
/ --> no more than 500MB
/usr --> depends how much executables you'd install, but I'd say 6GB is enough for a lot
/var --> depends how much logging you'd keep etc etc
SWAP it's advised to be 1.5 times the ammount of ram, so you do the math
/tmp --> depends on what will wind up in it, if you will allow storing of anything other than Apache/php session files to be stored, or if you'd allow your users to be able to dump files there
Best, if inodes/block size is not something than interests you, would be to to setup all but boot as LVM and than increase the disk space as you go along.
Thanks.
|
Add to Favourites Print this Article
Also Read