Disk Partitioning

First Time - Partitioning

[Ref: disklabel(8), fdisk(8), FAQ 14 - Disk Setup]

Partitioning is the process where you divide up your Hard Disk into logical segments (partitions) for storing files. A good approach is to not pre-optimise how your partition should look. This is to say, no single configuration will work for you in every possible system installation.

Sample Partition

Be prepared to build a few test systems to gauge the relative sizes your disk usage and requirements (if not already known.) Set your standard as something that will change as your needs and understanding grows.

For a 1st time installer, just building a test environment. The installer will give you two practical options:

  • use recommended settings from post 4.6 installers. The installation system, from 4.6 onwards provide a recommended partitioning of your available disk-space. This works well for many.
  • Custom partitioning. For a test, use the full drive as a single partition “/” That will allow you to use up all the hard disk for improving other knowledge of the OpenBSD system, without letting “out of disk space” errors clutter yourlearning.

Try those out and monitor how your disk space is used.

Use du and df to gather information about your actual usage pattern for a better understanding, determination of your partition needs.

du -h /partition

or

df -h

Swap Partition

The question on the size of your swap partition is a well worn path, here is a short table of information that you can use as a conversation starter.

The swap partition, usually on slower storage devices (at least much slower than RAM), is used to ‘fake’ available memory. When the system runs out of ‘real’ memory, it will continue to run by using the ‘faked’ memory. When more of this ‘fake’ memory is used, performance degrades as the Operating System has to swap out ‘real’ memory into storage (‘fake’ memory) and swap in ‘fake’ memory for use.

Because ‘swap’ tells your OS kernel to ‘fake’ available memory, the application asking for memory cannot differentiate between ‘faked’ memory and ‘real’ memory. When there’s lots of ‘swap’, applications will happily ask for more and more and more.

SizeDescription
MoreFail Slowly. You've run out of memory, 'fake' it. Swap memory to storage and keep running, until both are used up.
LessFail Quickly. You've run out of memory, 'fake' it for a little and when it fills up, stop!
NONEStop! There is no available 'fake' memory, when you run out of real memory, stop!

Hibernation

Hibernation technologies often use a ‘swap’ facility/space for putting the ‘RAM’ content onto storage media. Confirm the standard for your release/OS to help you decide how much space you need for ‘swap’.

Memory Hungry Applications

Graphics, Video Editing, Web browsers are classes of applications that use up a lot of memory (and may be slow because of ‘swap’ space being used. ‘More’ swap may be required for you to complete your work, or may be the cause of your application performance slowness.

Example Partitioning

The following is on simple partitioning scheme, on the premise that data on this configuration will not grow, the only partition expected to grow after installation being the /var/logs partition.

SliceMount PointCapacitydump;fsck
a/ 5G(default)
b(swap) 2G~
c(disk-slice) (disk)~
d/tmp 4G(default)
e/usr 10G(default)
f/home 10G(default)
g/var/log 20G(default)
h/var 10G(default)
i/storage * (available left-over)0 0

The above works well for us on 50G + Hard Disk Drives, for systems functioning primarily as non-caching proxies and firewalls.