partitioning server with 2 hard drives
dead_line at hotmail.com
Wed Sep 16 10:20:42 UTC 2020
Well, Thank you everyone, very interesting and helpful.
as Polytropon wrote,
using one disk for /, swap, /var, /tmp, /usr - to store the OS and the
user programs, and the other disk for /home
seems a good advice, and as everyone advised i will use 32 GB for single swap.
thank you very much, appreciate everyone's time and help
From: Polytropon <freebsd at edvax.de>
Sent: Tuesday, September 15, 2020 10:26 PM
To: Marwan Sultan <dead_line at hotmail.com>
Cc: FreeBSD Questions <freebsd-questions at freebsd.org>
Subject: Re: partitioning server with 2 hard drives
On Tue, 15 Sep 2020 21:34:35 +0000, Marwan Sultan wrote:
> Good day/Evening for all FreeBSDers 🙂
> I want to install latest FreeBSD for a business server
> erver with the following specification. :
> Intel Xeon E3-1240 v5 3.5GHz
> Hardware RAID Controller 1 GB Cache with BBU
> 16 GB DDR4 RAM - Total
> 1 TB 7200 SATA
> 1 TB 7200 SATA
> I understand its advised to create it in this order and SWAP double
> (or triple) of the RAM (is 50 GB ok) ?
That has been true in the past, even though the suggestion was "use
2 x the maximum of RAM the machine can be equipped with". While you
should definitely have a swap space today, just in case, the size
of it depends on your expected workload RAM requirements vs. the
installed RAM. From your description, something like 16 GB or even
32 GB should be okay. It's just convenient that _if_ swap should be
needed, it's there.
What about /home? :-)
While the idea of "functional partitioning" might not be relevant
on desktop systems, it can have advantages on a server. Especially
making /tmp (and probably /var, due to /var/log and /var/tmp) an
own partition could save you in case of a "runaway writer", i. e.,
a program that keeps writing to disk until it's full.
For /tmp, as well as any partition where user-controlled files can
be placed, it has been correctly suggested to use specific mount
options such as "noexec" and "nosuid". You can immediately see the
advantage of such per-partition settings. ;-)
Also the ability to use dump and restore for per-partition backup
and restore might be quite useful.
> Questions :
> 1. Would you kindly advise what is the best partitioning scheme
> on 2 hard drives?
Depends on what kinds of applications you want to run on that server,
and if you want to use those drives in some kind of RAID setting, such
as mirroring or striping. If not, a possible solution could be to
use one disk for /, swap, /var, /tmp, /usr - to store the OS and the
user programs, and the other disk for /home or any other user-supplied
data (such as databases). However, that is just _one_ possibilities.
What is best for you depends on what you intend to do with the system.
> 2. in FreeBSD handbook says i would better create swap on both
> partitions? may someone advise HOW and WHY ?
This is possible, but is not required. Especially on systems that tend
to actually use swap, this could be an advantage. It could be for speed
advantages, that's the WHY. And the HOW is no different from a one-disk
system. It's just a second device in /etc/fstab that is activated by
the "swapon" command during automatic system startup.
See "man 8 swapctl" and "man 8 swapinfo" for details.
> I'm a little confused because of the 2 hard drives.
No need to. There are many approaches that work. Which one is useful
for you depends on your expected usage.
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions