<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
<wml>
  <card id="article" title="Triple booting on an old PC, part 2: OpenBSD">
	<p>This is a command-line editor similar to fdisk, but with different commands and it edits the disklabel, not the whole disk's partition table. Let's take a look at the partition table with "p":</p>
	<pre>
wd0&gt; p
OpenBSD area: 629147648-838862048; size: 209715200; free: 209715200
#          size       offset fstype [fsize bsize    cpg]
  c:     931.5G            0 unused
  i:     100.0G         2048   NTFS
  j:     200.0G    209717248  MSDOS</pre>
    <p>Unlike Linux, which assigns numbers to partitions sequentially (sda1, sda2, ...), OpenBSD often reserves letters for specific partitions. For instance, partition "c" is not a real partition, but the entire disk. Partitions i and j here are the MBR parttions of other operating systems.</p>
    <p>Now let's make some partitions to install OpenBSD on. I'll use the following partition layout:</p>
	<pre>
root - 32 GB
swap - 4 GB
/home - rest of disklabel space</pre>
	<p>I use this straightforward setup on most of my Unix systems - 32 GB is more than enough software space for me and a separate home partition helps when reinstalling/backing up data - this way data and the OS are on separate partitions!</p>
	<p>You can also set up more partitions if you want, such as /var (to limit logging space) or /usr/local (to enhance security with wxlocal), but this leaves less space for generic data. If you want the system to just work, this 3-partition layout will be enough.</p>
	<p>Let's make the root partition first by typing "a":</p>
	<pre>
wd0&gt; a
partition to add: [a]
offset: [629147648]
size: [209715200] 32g
FS type: [4.2BSD]
mount point: [none] /</pre>
    <p>In "partition to add" and "offset", we just press Enter to use the default values. In "size", we obviously type in the size - the default size in sectors but we can use gigabytes like "32G". For filesystem type we use the default 4.2BSD and for mountpoint we type "/" - the Unix root directory.</p>
    <p>This created the "a" partition - in OpenBSD the root partition is always letter "a". Now let's make the swap partition:</p>
    <pre>
wd0*&gt; a
partition to add: [b]
offset: [696257080]
size: [142605760] 4g
FS type: [swap] swap</pre>
    <p>This computer has 1 GB of RAM, so 4 GB of swap space should be more than enough and OpenBSD doesn't use a lot of RAM. The "b" partition is always swap, so the disklabel editor automatically detected the filesystem type as swap.</p>
    <p>Now for the /home partition we use the default size so it takes up remaining disklabel space:</p>
    <pre>
wd0*&gt; a
partition to add: [d]
offset: [704659095]
size: [134203753]
FS type: [4.2BSD]
mount point: [none] /home</pre>
    <p>Let's take a look at the disklabel partition table with "p":</p>
    <pre>
wd0*&gt; p
OpenBSD area: 629147648-838862048; size: 209715200; free: 9
#          size       offset fstype [fsize bsize    cpg]
  a:   67109440    629147640 4.2BSD   2048 16384      1 # /
  b: 
  c:     931.5G            0 unused
  i:     100.0G         2048   NTFS
  j:     200.0G    209717248  MSDOS</pre>
    <p>Looks good - we save the disklabel and exit the editor by typing "q". If you want to exit without saving, type "x".</p>
    <p>The system might ask if you want to initialize any other disks - type "done", as we're only using one disk in this OpenBSD setup.</p>
	<p><a href="quadb2_5.wml">Page 5</a></p>
	<p><a href="quadb2_3.wml">Page 3</a></p>
    <p><a href="#article">Top</a></p>
    <p><a href="#menu">Menu</a></p>
  </card>
  <card id="menu" title="crimson_phoneme's website">
    <p mode="wrap"><img src="../gfx/about.wbmp" alt="" /><a href="../index.wml#about">About</a></p>
    <p><img src="../gfx/blog.wbmp" alt="" /><a href="../index.wml#blog">Blog</a></p>
	<p><img src="../gfx/comp.wbmp" alt="" /><a href="../comp.wml">My computers</a></p>
	<p><img src="../gfx/links.wbmp" alt="" /><a href="../links.wml">Links</a></p>
  </card>
</wml>

