Partitions are not assigned any particular letters -- with the exception
of a (root), b (swap) and c (entire disk), the rest of the partitions
(through letter p) are available for use as you desire.
On the root disk, the two partitions 'a' and 'b' must be created.
The installation process will not proceed until these two partitions
are available. 'a' will be used for the root filesystem (/) and 'b'
will be used as swap space.
After a little thought, we decide to create just enough partitions to
allow the creation of the recommended separate filesystems
(/, /tmp, /var, /usr, /home) along with a swap partition:
wd0a: / (root) - 150M. Should be more than enough.
wd0b: (swap) - 300M.
wd0d: /tmp - 120M. /tmp is used for building some software,
120M will probably be enough for most things.
wd0e: /var - 80M. If this were to be a web or mail server,
we'd have made this partition much larger,
but, that's not what we are doing.
wd0g: /usr - 3G. We want this partition to be large enough to
load a few user applications, plus be able to
update and rebuild the system by source if
desired or needed. The Ports tree will be here
as well, which will take almost 140M of this
space before ports are built. If one was
planning on building many applications from
source using ports rather than pre-built
packages, you might want a lot more space here.
wd0h: /home - 4G. This will allow plenty of user file space.
How much disk space is required for OpenBSD?
Obviously, the answer to this question varies tremendously based on your
use of the system. However, these numbers can be used as a starting point:
(root) 100MB
/usr 250MB (no X) or 400MB (with X)
/var 25MB
/tmp 50MB
swap 32MB
Those are minimum suggested filesystem sizes for a full system install.
The numbers include enough extra space to permit you to run a typical
home system that is connected to the Internet, but not much else.
For your first attempt at an experimentation system, one big / partition
and swap may be easiest until you know how much space you need. By doing
this you will be sacrificing some of the default security features of
OpenBSD that require separate filesystems for /, /tmp, /var, /usr and
/home. However, you probably should not be going into production with
your first OpenBSD install.
A system exposed to the Internet or other hostile forces should have a
separate /var (and maybe even a separate /var/log) for logging.
If you outgrow a partition, you can allocate a new partition from your
unused space, duplicate your existing partition to the new partition,
change /etc/fstab to point to the new partition, remount, you now have
more space. http://www.openbsd.org/faq/faq10.html#DupFS
How do I duplicate a filesystem?
To duplicate your filesystem use dump(8) and restore(8). For example, to
duplicate everything under directory SRC to directory DST, do a:
cd /SRC; dump 0f - . | (cd /DST; restore -rf - )
dump is designed to give you plenty of backup capabilities, and it may be
an overkill if you just want to duplicate a part of a (or an entire)
filesystem. The command tar(1) may be faster for this operation. The format
looks very similar:
cd /SRC; tar cf - . | (cd /DST; tar xpf - )
There are several reasons for using separate filesystems, instead of shoving
everything into one or two filesystems:
Security:
You can mark some filesystems as 'nosuid', 'nodev', 'noexec',
'readonly', etc. This is done by the install process, if you use
the above described partitions.
Stability:
A user, or a misbehaved program, can fill a filesystem with garbage if
they have write permissions for it. Your critical programs, which of
course run on a different filesystem, do not get interrupted.
Speed:
A filesystem which gets written to frequently may get somewhat
fragmented. (Luckily, the ffs filesystem that OpenBSD uses is not
prone to heavy fragmentation.)
Integrity:
If one filesystem is corrupted for some reason then your other
filesystems are still OK.
Size:
Many machines have limits on the area of a disk where the boot ROM can
load the kernel from. In some cases, this limit may be very small (504M
for an older 486), in other cases, a much larger limit (for example, 2G,
8G, or 128G on i386 systems). As the kernel can end up anywhere within
the root partition, the entire root partition should be within this area.
For more details, see this section. A good guideline might be to keep
your / partition completely below 2G, unless you know your platform (and
particular machine) can handle more (or less) than that.
spc@ruby[~] $ df
Filesystem 512-blocks Used Avail Capacity Mounted on
/dev/wd0a 158574 47858 102788 32% /
/dev/wd0d 158638 2 150706 0% /tmp
/dev/wd0e 158638 68608 82100 46% /var
/dev/wd0g 693614 308070 350864 47% /usr
/dev/wd0h 1305660 114 1240264 0% /home
spc@ruby[~] $ cat /etc/fstab
/dev/wd0a / ffs rw 1 1
/dev/wd0d /tmp ffs rw 1 2
/dev/wd0e /var ffs rw 1 2
/dev/wd0g /usr ffs rw 1 2
/dev/wd0h /home ffs rw 1 2
/dev/cd0c /cdrom cd9660 ro,noauto 0 0
OpenBSD partitioning convention is that 'a' is always '/', 'b' is swap
and 'c' is the whole disk.
/dev/wd0a 100M /
/dev/wd0d 400M /tmp
/dev/wd0e 4GB /var
/dev/wd0g 2GB /usr
/dev/wd0h 5GB /home
root@diamond[~] # df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/wd0a 502M 36.8M 440M 8% /
/dev/wd0h 164M 18.0K 156M 0% /home
/dev/wd0d 251M 13.7M 225M 6% /tmp
/dev/wd0g 1.2G 422M 748M 36% /usr