partitioning server with 2 hard drives

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

partitioning server with 2 hard drives

Marwan Sultan
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) ?
/
swap
var
/tmp
/usr

Questions :

  1.  Would you kindly advise what is the best partitioning scheme on 2 hard drives?
  2.  in FreeBSD handbook says i would better create swap on both partitions? may someone advise HOW and WHY ?

 I'm a little confused because of the 2 hard drives.

thank you for your help


  *   Marwan

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: partitioning server with 2 hard drives

Michael Sierchio
On Tue, Sep 15, 2020 at 2:35 PM Marwan Sultan <[hidden email]> 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) ?
> /
> swap
> var
> /tmp
> /usr
>

The swap advice is obsolete and deprecated.  With only two drives, you'll
have to decide whether to RAID1 or not.

I'm a firm believer that any world-writable directory ( /tmp, /var/tmp )
should be a separate filesystem w/ rw,noexec,nosuid. I think that an 8GB
swap partition on each drive would be more than enough.  You can
extrapolate from this.

--

"Well," Brahmā said, "even after ten thousand explanations, a fool is no
wiser, but an intelligent person requires only two thousand five hundred."

- The Mahābhārata
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: partitioning server with 2 hard drives

Manish Jain
In reply to this post by Marwan Sultan


On 2020-09-16 03:04, 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) ?
> /
> swap
> var
> /tmp
> /usr
>
> Questions :
>
>    1.  Would you kindly advise what is the best partitioning scheme on 2 hard drives?
>    2.  in FreeBSD handbook says i would better create swap on both partitions? may someone advise HOW and WHY ?
>
>   I'm a little confused because of the 2 hard drives.
>
> thank you for your help
>
>
>    *   Marwan
>
> _______________________________________________
> [hidden email] mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[hidden email]"
>

Hi Marwan,

GPT is best.
You should have a single swap partition, size 32 GB.

Regards,
Manish Jain
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: partitioning server with 2 hard drives

Steve O'Hara-Smith
In reply to this post by Marwan Sultan
On Tue, 15 Sep 2020 21:34:35 +0000
Marwan Sultan <[hidden email]> 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

        The first question is do you need 2TB of available storage or will
1TB be sufficient (alternatively if you do need 2TB of storage can you use
two 2TB drives).

> I understand its advised to create it in this order and SWAP double (or
> triple) of the RAM (is 50 GB ok) ? /

        That advice is old and if you need to actively use swap then you
need more RAM. That being said disc space is cheap so go for 32GB spread
over the two drives - spreading swap over two drives allows parallel access
essentially doubling the swap bandwidth.

        I would go for a ZFS mirror using the rest of the drives, set up
a weekly scrub and never worry about a drive failure again.

--
Steve O'Hara-Smith <[hidden email]>
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: partitioning server with 2 hard drives

Polytropon
In reply to this post by Marwan Sultan
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, ...
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: partitioning server with 2 hard drives

Michael Sierchio
In reply to this post by Steve O'Hara-Smith
On Tue, Sep 15, 2020 at 3:19 PM Steve O'Hara-Smith <[hidden email]> wrote:

>
>
>         I would go for a ZFS mirror using the rest of the drives, set up
> a weekly scrub and never worry about a drive failure again.
>

When, not if, a drive fails, will you find one with precisely the same
geometry / capacity to replace the failed drive and remirror?  Can you do
so before the other drive fails (which might be statistically likely)?

There are good online MMTDL, MTTF, MTBF numbers for various raid levels for
ZFS. None would lead me to be so glib.

--

"Well," Brahmā said, "even after ten thousand explanations, a fool is no
wiser, but an intelligent person requires only two thousand five hundred."

- The Mahābhārata
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: partitioning server with 2 hard drives

David Christensen
In reply to this post by Marwan Sultan
On 2020-09-15 14:34, 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) ?
> /
> swap
> var
> /tmp
> /usr
>
> Questions :
>
>    1.  Would you kindly advise what is the best partitioning scheme on 2 hard drives?

ZFS is supported OOTB on FreeBSD.  Choose the "Auto (ZFS)" option for
partitioning the system drive.  You can set the swap size as you choose
(I use 2g).  You can also mirror and/or encrypt swap.


I keep my operating system images on single, non-RAID SSD's.  This makes
it easy to backup, clone, and restore raw binary images.  If you install
onto a 1 TB drive, imaging operations will be impractical.


Unfortunately, the FreeBSD installer  does not provide an obvious way to
limit the size of the FreeBSD installation -- it uses the entire drive.
So, unless you are prepared to resort to more complex measures, the easy
answer is to get a 16 GB SSD and install onto that.


Once your system is installed, create a ZFS pool using the two 1 TB
HDD's as a mirror.  Create filesystems, create volumes, and/or set
properties as required for your needs,


>    2.  in FreeBSD handbook says i would better create swap on both partitions? may someone advise HOW

Let the installer do it for you.


> and WHY ?

Having swap partitions on multiple devices allows the kernel to reduce
contention and/or perform concurrent I/O.


David
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: partitioning server with 2 hard drives

Steve O'Hara-Smith
In reply to this post by Michael Sierchio
On Tue, 15 Sep 2020 16:10:05 -0700
Michael Sierchio <[hidden email]> wrote:

> On Tue, Sep 15, 2020 at 3:19 PM Steve O'Hara-Smith <[hidden email]>
> wrote:
>
> >
> >
> >         I would go for a ZFS mirror using the rest of the drives, set up
> > a weekly scrub and never worry about a drive failure again.
> >
>
> When, not if, a drive fails, will you find one with precisely the same
> geometry / capacity to replace the failed drive and remirror?  Can you do

        You don't need to, you just need one big enough, and 1TB drives are
very easy to find.

> so before the other drive fails (which might be statistically likely)?

        Unless you do something daft like RMA the drive and wait then yes
IME.

> There are good online MMTDL, MTTF, MTBF numbers for various raid levels
> for ZFS. None would lead me to be so glib.

        Well OK there are no guarantees but a mirror is orders of magnitude
better than a single drive.

--
Steve O'Hara-Smith <[hidden email]>
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: partitioning server with 2 hard drives

Marwan Sultan
In reply to this post by Polytropon
Good day,

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

  *   Marwan


________________________________
From: Polytropon <[hidden email]>
Sent: Tuesday, September 15, 2020 10:26 PM
To: Marwan Sultan <[hidden email]>
Cc: FreeBSD Questions <[hidden email]>
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.

> /
> 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, ...
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: partitioning server with 2 hard drives

Steve O'Hara-Smith
In reply to this post by Steve O'Hara-Smith
On Wed, 16 Sep 2020 21:03:25 +0100
RW via freebsd-questions <[hidden email]> wrote:

> On Wed, 16 Sep 2020 06:54:32 +0100
> Steve O'Hara-Smith wrote:
>
> > On Tue, 15 Sep 2020 16:10:05 -0700
> > Michael Sierchio <[hidden email]> wrote:
>
> > > When, not if, a drive fails, will you find one with precisely the
> > > same geometry / capacity to replace the failed drive and remirror?
> > > Can you do  
> >
> > You don't need to, you just need one big enough, and 1TB
> > drives are very easy to find.
>
> Just out of curiosity, does ZFS leave a small amount of space unused on
> a raw drive to allow for a replacement being very slightly smaller?  

        No, so what I usually do is create a partition a bit smaller than
the drive and give that to ZFS.

--
Steve O'Hara-Smith <[hidden email]>
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"