Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Sep 2020 00:26:06 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Marwan Sultan <dead_line@hotmail.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: partitioning server with 2 hard drives
Message-ID:  <20200916002606.52725f1d.freebsd@edvax.de>
In-Reply-To: <MWHPR06MB32479D288A8D10AD73FC6A329A200@MWHPR06MB3247.namprd06.prod.outlook.com>
References:  <MWHPR06MB32479D288A8D10AD73FC6A329A200@MWHPR06MB3247.namprd06.prod.outlook.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

> /
> swap
> var
> /tmp
> /usr

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.


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200916002606.52725f1d.freebsd>