Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Server partitioning examples?

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
JustSomeGeek



Joined: Tue May 01, 2012 2:07 pm
Posts: 19

PostPosted: Sat Jun 23, 2012 12:32 am    Post subject: Server partitioning examples? Reply with quote

Hi folks,

I'm begging again, sorry!

I'm looking for a few good examples of how people have partitioned drives for different scenarios, and an explanation as to why it was done that way.

I have a 128Gb SSD for the OS and VMs, but i don't want it to get thrashed for no reason. It's mostly been bought to save power and cut down the noise in the living room.

I have other HDDs for storage duties and was thinking that i should put the user data on one of them.
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2422

PostPosted: Sat Jun 23, 2012 1:49 am    Post subject: Reply with quote

Use 28GB for the OS (divide between /, /boot, /tmp, /usr, /opt and /var) then allow some 10GB per VM in a special directory, /virtmach. Make sure this directory is read/writeable to the VM application! Any data, especially personal, should be on a RAID array, preferably RAID 5 or at least RAID 1. Use regular, high capacity disks for that.

Note that / and /boot are primary partitions, the others are on an extended partition. Use a journalling filesystem, like ext3 or ext4, JFS, XFS or BtrFS (or even ReiserFS if you run Suse) and be generous in allocating space for partitions: /boot should be at least 512MB and / a minimum of 5 GB. Set up a daily cron job to update your system and maybe, if you're feeling adventurous, build your own custom kernel. The latter might be required, if your chosen distro doesn't support all your hardware yet. Chances are a newer kernel will solve the issue Smile
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8364
Location: Warrington, UK

PostPosted: Sat Jun 23, 2012 9:19 am    Post subject: Reply with quote

Just use LVM and stop worrying about partitioning or adding drives.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
JustSomeGeek



Joined: Tue May 01, 2012 2:07 pm
Posts: 19

PostPosted: Sat Jun 23, 2012 10:24 am    Post subject: Reply with quote

Thanks for that. I was hoping there might be a site that has a good article with reasoning on it too.

I'm afraid i haven't touched LVM before, so i'd be way out of my comfort zone. I wuss out when i read about mountpoints as it is!
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8364
Location: Warrington, UK

PostPosted: Sat Jun 23, 2012 12:03 pm    Post subject: Reply with quote

There is no "right" way of partitioning for all uses, everyone's needs are different and even your needs can change. That's why I always use LVM as you are not committed to any particular layout. Most distro installers have an option to set up LVM these days.

Whatever you do, if you are partitioning a new drive, use a GPT partition table to avoid all that kludging around with primary and logical partitions. It's simpler. cleaner and far easier to recover from a disaster (GPT keeps a backup copy of the partition table, DOS logical partitions don't even keep one copy of the partition table).
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
JustSomeGeek



Joined: Tue May 01, 2012 2:07 pm
Posts: 19

PostPosted: Sat Jun 23, 2012 12:14 pm    Post subject: Reply with quote

I am going with GPT after reading your comments and a couple of articles though. I will tackle LVM sometime, but i need to get this up and running and keep it simple for starters.

Is putting /var & /tmp on a separate HDD a good idea?

I reason that if i do get any nasty DDOS thingies happening to Apache, it will only thrash the HDD and the rest of the system should be unaffected. Similar with /tmp if i do something stupid, i figure it will mean less wear on the SSD.
Back to top
View user's profile Send private message
JustSomeGeek



Joined: Tue May 01, 2012 2:07 pm
Posts: 19

PostPosted: Sat Jun 23, 2012 12:28 pm    Post subject: Reply with quote

Dutch_Master wrote:
Use 28GB for the OS (divide between /, /boot, /tmp, /usr, /opt and /var) then allow some 10GB per VM in a special directory, /virtmach. Make sure this directory is read/writeable to the VM application! Any data, especially personal, should be on a RAID array, preferably RAID 5 or at least RAID 1. Use regular, high capacity disks for that.

Note that / and /boot are primary partitions, the others are on an extended partition. Use a journalling filesystem, like ext3 or ext4, JFS, XFS or BtrFS (or even ReiserFS if you run Suse) and be generous in allocating space for partitions: /boot should be at least 512MB and / a minimum of 5 GB. Set up a daily cron job to update your system and maybe, if you're feeling adventurous, build your own custom kernel. The latter might be required, if your chosen distro doesn't support all your hardware yet. Chances are a newer kernel will solve the issue Smile


I lost you at /virtmach Smile

I was going to bung ext4 on everything as it supports TRIM and big drives (unless i misunderstood something).

Backing up the system to one of the other drives is what i had i mind. I'm not ready for RAID on Linux yet.

Cron is also a nono at this stage. And as for custom kernels, i can peel a pistachio nut, but that's as close as i will get for probably many years!

Thanks though! Smile
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8364
Location: Warrington, UK

PostPosted: Sat Jun 23, 2012 6:13 pm    Post subject: Reply with quote

I'd certainly put /var on a separate partition on a server, as much of the data is stored there (it's almost /home to a server). It also stops the root filesystem being compromised if a runaway process fills its log files.

/tmp doesn't contain much so I generally put it on a tmpfs: faster, more convenient and automatically cleared at a reboot.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
JustSomeGeek



Joined: Tue May 01, 2012 2:07 pm
Posts: 19

PostPosted: Sat Jun 23, 2012 8:38 pm    Post subject: Reply with quote

Dev MB MP/Vol Type

sda1 100 /boot ext4
sda2 70000 / ext4
sda3 50000 /home ext4
sda4 4000 /tmp ext4
sda5 6970 swap

sdb1 20000 /var ext4
sdb2 1000 ext4
sdb3 765431 ext4

sda=SSD, sdb=HDD

I want to put /var/logs on sdb2 but the CenOS Disk Druid only offers 8 mount points, and that's not one of them, so i'm not sure how to get this to happen yet.

Any major flaws in this plan?
Back to top
View user's profile Send private message
JustSomeGeek



Joined: Tue May 01, 2012 2:07 pm
Posts: 19

PostPosted: Sat Jun 23, 2012 10:10 pm    Post subject: Reply with quote

Ah. I figured out you can actually type in the drop-down mount point box. Doh!
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8364
Location: Warrington, UK

PostPosted: Sat Jun 23, 2012 10:12 pm    Post subject: Reply with quote

JustSomeGeek wrote:
Any major flaws in this plan?


Yes, wasting 4GB on /tmp when it usually only uses a megabyte at most. Put is on a tmpfs by adding this to /etc/fstab

Code:
tmpfs   /tmp   tmpfs   noatime,mode=1777   0 0

_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
JustSomeGeek



Joined: Tue May 01, 2012 2:07 pm
Posts: 19

PostPosted: Sat Jun 23, 2012 11:15 pm    Post subject: Reply with quote

Ah. Something else i misunderstood. I assumed it had a similar role to the windows temp. Unpacking archives, pre-processed downloads etc.

I never even bothered to read that bit of the book. Thanks again, some more light reading tonight!
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2422

PostPosted: Sat Jun 23, 2012 11:34 pm    Post subject: Reply with quote

Having /tmp over 4.4GB in size allows the kernel to copy the contents of a DVD quickly... Wink
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8364
Location: Warrington, UK

PostPosted: Sat Jun 23, 2012 11:39 pm    Post subject: Reply with quote

No it doesn't because the DVD drive is still dog slow by comparison Razz

Anyway, to copy files quickly, the kernel caches them in RAM, and tmpfs uses the exact same mechanisms. It's basically a RAM cache of a disk filesystem without the disk, perfect for temporary data.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2422

PostPosted: Sun Jun 24, 2012 4:06 am    Post subject: Reply with quote

Makes sense... Embarassed
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast