Server partitioning examples?

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Server partitioning examples?

Postby JustSomeGeek » Fri Jun 22, 2012 11:32 pm

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.
JustSomeGeek
 
Posts: 19
Joined: Tue May 01, 2012 1:07 pm

Postby Dutch_Master » Sat Jun 23, 2012 12:49 am

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 :)
Dutch_Master
LXF regular
 
Posts: 2471
Joined: Tue Mar 27, 2007 1:49 am

Postby nelz » Sat Jun 23, 2012 8:19 am

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)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby JustSomeGeek » Sat Jun 23, 2012 9:24 am

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!
JustSomeGeek
 
Posts: 19
Joined: Tue May 01, 2012 1:07 pm

Postby nelz » Sat Jun 23, 2012 11:03 am

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)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby JustSomeGeek » Sat Jun 23, 2012 11:14 am

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.
JustSomeGeek
 
Posts: 19
Joined: Tue May 01, 2012 1:07 pm

Postby JustSomeGeek » Sat Jun 23, 2012 11:28 am

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 :)


I lost you at /virtmach :-)

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! :-)
JustSomeGeek
 
Posts: 19
Joined: Tue May 01, 2012 1:07 pm

Postby nelz » Sat Jun 23, 2012 5:13 pm

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)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby JustSomeGeek » Sat Jun 23, 2012 7:38 pm

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?
JustSomeGeek
 
Posts: 19
Joined: Tue May 01, 2012 1:07 pm

Postby JustSomeGeek » Sat Jun 23, 2012 9:10 pm

Ah. I figured out you can actually type in the drop-down mount point box. Doh!
JustSomeGeek
 
Posts: 19
Joined: Tue May 01, 2012 1:07 pm

Postby nelz » Sat Jun 23, 2012 9:12 pm

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: Select all
tmpfs   /tmp   tmpfs   noatime,mode=1777   0 0
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby JustSomeGeek » Sat Jun 23, 2012 10:15 pm

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!
JustSomeGeek
 
Posts: 19
Joined: Tue May 01, 2012 1:07 pm

Postby Dutch_Master » Sat Jun 23, 2012 10:34 pm

Having /tmp over 4.4GB in size allows the kernel to copy the contents of a DVD quickly... ;)
Dutch_Master
LXF regular
 
Posts: 2471
Joined: Tue Mar 27, 2007 1:49 am

Postby nelz » Sat Jun 23, 2012 10:39 pm

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

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)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby Dutch_Master » Sun Jun 24, 2012 3:06 am

Makes sense... :oops:
Dutch_Master
LXF regular
 
Posts: 2471
Joined: Tue Mar 27, 2007 1:49 am


Return to Help!

Who is online

Users browsing this forum: No registered users and 0 guests