Front | Info | Lists | Newsfeeds | Study Guide | What is BSD? RSS  

Introduction to OpenBSD for Linux users (Part 1)

By Rafael Coninck Teigao
SafeCore Network Solutions


Several years ago I was doing security research for a company and after reading so much about OpenBSD I decided to give it a try and installed its version 2.3. I came from a Linux background and was quite familiar with SunOS, so I knew OpenBSD wouldn't be so hard to deal with.

In fact I was right on that and my new operating system was running smooth after some time installing it through the Net. But my jumpstart time would've been better if I wasn't struggling with it trying to apply Linux's concepts.

Now I've seem many people on OpenBSD mailing lists that came from a Linux world and were having the very same problems I had on their first contact with their brand new OS. That's why I decided to write these articles, to make it easier for newcomers. Enjoy!

Installing OpenBSD

For matter of simplicity, I'm going to focus on a whole disk, single system installation, but if you feel experienced enough on Linux disk-partitioning and are comfortable with its fdisk, you can take a look at[(1) INSTALL.linux] and choose to do a dual-boot system.

Preparing the necessary files

First you will need a boot disk, so go choose a server from the [(2) mirrors list], and download the file 3.2/i386/floppy32.fs and place a formatted (or otherwise blank) floppy in your drive, then issue:

dd if=floppy32.fs of=/dev/fd0 >enter<

This copies the bootable floppy image to your floppy disk.

Now you have to choose where you are going to install from. Broadband is common nowadays, but if you don't have it, you've got 3 choices:

  1. log on your Linux, go to your htdocs directory and create a new directory named OpenBSD. Inside it, download the files from 3.2/i386/, you can use the same mirror used for the floppy32.fs file. The file list should be:
    INSTALL.mbr INSTALL.os2br MD5 TRANS.TBL base32.tgz
    boot.catalog bsd bsd.rd cdrom32.fs comp32.tgz etc32.tgz
    floppy32.fs floppyB32.fs floppyC32.fs game32.tgz man32.tgz misc32.tgz
    xbase32.tgz xfont32.tgz xserv32.tgz xshare32.tgz    
    Now fire your Apache up and go to section 2.2.
  2. log on your Linux, download the same files from choice #1, burn a CD and go to section 2.2.
  3. buy the CD from [(3) OpenBSD Orders] and wait a few weeks, then go to section 2.2.

Booting the floppy and installing

Once you boot, you are going to be greeted by the installer and the process will stop, asking whether you want to proceed with the install or not. After reading the greet, select the default terminal (just type >enter<), choose your keyboard encoding (if it is different from standard US) and type y >enter<.

The install then will ask which disk it should install to. If you have more then one disk available, make sure to choose to correct one. This is very important because you are going to DESTROY ALL PREVIOUSLY STORED DATA on the harddrive. One important thing you'll notice is that the device name convention differs from that on Linux, being of the format xx#, e. g. wd0=hda, wd1=hdb and so fort. So be careful and choose your drive. Since you are going to use the whole disk, just type yes >enter< for the next question.

The next step will be creating a disk label, or logical partitions, inside your A6 (OpenBSD) partition. At the prompt, if you type p >enter< you should see:

       type: ESDI

       disk: ESDI/IDE disk

       label: Maxtor 86480D6

       bytes/sector: 512

       sectors/track: 63

       tracks/cylinder: 15

       sectors/cylinder: 945

       cylinders: 13395

       total sectors: 12658776

       free sectors: 12658713

       rpm: 3600


       16 partitions:

       #        size    offset    fstype   [fsize bsize   cpg]

         a: 12643092      63   unused       0    0

         c: 12658776       0   unused       0    0

Of course your size may differ, but this is just to give you a hint of what you should see. Notice the unused fstype. That means that you have no fstype assigned for partition a. Partition c comprises the whole disk. You are now going to set the partitions. At least 5 partitions are recommended, they are: /, swap, /var, /home and /usr. How much space you will allocate for each partition is up to you, take a look at [(4) partitions space needed]. Here you are going to add 6:

       > d a >enter<

       > a a >enter<

       offset: [63] >enter<

       size: [12658713] 80m >enter<

       Rounding to nearest cylinder: 163422

       FS type: [4.2BSD] >enter<

       mount point: [none] / >enter<

       > a b >enter<

       offset: [163485] >enter<

       size: [12495291] 300m >enter<

       Rounding to nearest cylinder: 614250

       FS type: [swap] >enter<

       > a d >enter<

       offset: [777735] >enter<

       size: [11881041] 80m >enter<

       Rounding to nearest cylinder: 163485

       FS type: [4.2BSD] >enter<

       mount point: [none] /tmp >enter<

       > a e >enter<

       offset: [941220] >enter<

       size: [11717556] 80m >enter<

       Rounding to nearest cylinder: 163485

       FS type: [4.2BSD] >enter<

       mount point: [none] /var >enter<

       > a f>enter<

       offset: [1104705] >enter<

       size: [11554071] 2g >enter<

       Rounding to nearest cylinder: 4193910

       FS type: [4.2BSD] >enter<

       mount point: [none] /usr >enter<

       > a g >enter<

       offset: [5298615] >enter<

       size: [7360161] >enter<

       FS type: [4.2BSD] >enter<

       mount point: [none] /home >enter<

Now let's see what the label looks like and save it:

      > p >enter<

       device: /dev/rwd0c

       type: ESDI

       disk: ESDI/IDE disk

       label: Maxtor 86480D6

       bytes/sector: 512

       sectors/track: 63

       tracks/cylinder: 15

       sectors/cylinder: 945

       cylinders: 13395

       total sectors: 12658776

       free sectors: 0

       rpm: 3600


       16 partitions:

       #        size    offset       fstype     [fsize   bsize   cpg]

        a:   163422       63     4.2BSD     1024   8192    16  # /

        b:   614250   163485       swap

        c: 12658776        0      unused        0       0

        d:   163485   777735     4.2BSD     1024   8192    16  # /tmp

        e:   163485   941220     4.2BSD     1024   8192    16  # /var

        f:  4193910  1104705   4.2BSD     1024   8192    16  # /usr

        g:  7360161  5298615   4.2BSD     1024   8192    16  # /home

       > w >enter<

       > q >enter<

The install is going to ask for confirmation on your mount points. If you keep hitting enter, it'll just loop, giving you the opportunity to make any changes. If you feel everything is ok, just type done >enter<. It now asks whether you want to configure another disk, but let's leave that alone for a moment, type done >enter< and y >enter< for formating the partitions.

Configuring the network is really straightforward, you should simply follow the dialog, press >enter< on Media directives? [] and Escape to shell? [no], select your root password, choose to use (>enter<) or not (n >enter<) X Window and then select your installation media.

The installation media can be ftp, http, CD-ROM or local disk. If you've bought or burned a CD, select CD-ROM and, if appropriate, configure the right directory as shown bellow. Otherwise select http.

Again, if you have broadband, you can install through the Internet, so choose yes when prompted to be shown a list of servers and select one close to you by typing it's number and >enter<. If you need to use a proxy server, configure it by typing http://your.proxy.address:port/ >enter<, or just >enter< to use none. If you decided to download the files to a local computer, choose no when prompted to be shown a list of servers and type http://your.files.ip.address/ >enter<.

When you burned the CD or downloaded the files to your htdocs/OpenBSD directory, you most likely didn't create the directories 3.2/i386, so now you have to change it when prompted

Enter the directory relative to the mount point that contains

the file: [3.2/i386]

to /OpenBSD or, if you created any different directory, to the one you created.

When prompted to select the packages to install, type * >enter< to select all packages, then done >enter< to start the install. The install software is going to ask if you're ready to begin downloading the files or to install them, just type y >enter<. If you have less then 16Mb of RAM, take a look at the [(5) OpenBSD Installation Guide] before beginning to download.

Your installation is almost done now. Just type >enter< to Extract more sets? [n] and select your timezone. Now type halt on the command prompt, remove the floppy from your drive and press any key to reboot.

My system stopped at "Using Drive: 0 Partition: 3"

This can be for two reasons: incompatibility between your BIOS and OpenBSD MBR or a drive geometry problem. As of OpenBSD 3.1 it is expected that no incompatibilities are found, so let's assume it is a drive geometry problem.

Geometry problems usually occur when you move a drive from one computer to another, having some BIOS configuration differences between them. To solve this you should boot from the floppy you created for the install and at the boot> prompt type boot wd0a:/bsd (changing, of course, wd for whatever drive is your OpenBSD installed on). Then log in as root and type:

cp /usr/mdec/boot /boot

/usr/mdec/installboot -v /boot /usr/mdec/biosboot wd0

This is going to install and configure the partition boot loader to correctly boot your geometry. If it does not solve your problem, you may have found an incompatibility, so take a look at [(6) "Using Drive: 0 Partition: 3" - i386 specific].


By now you should have your OpenBSD 3.2 up and running. You can configure your X Window as you would on Linux and have basic Internet access with lynx. On the next articles from this series, I am going to explain the firewall and nat interfaces, the port and packages systems and system configurations, so you'll be able to turn your OpenBSD on a workstation or server.

For more information, please take a look at the [(7) OpenBSD FAQ] and the mailing lists, and don't get upset with the rudeness of some answers, developers are usually stressed people and don't like when you don't do your homework (checking the FAQ and mail archives before posting is usually a Good Idea).


(1) INSTALL.linux

(2) mirrors list

(3) OpenBSD Orders

(4) partitions space needed

(5) OpenBSD Installation Guide

(6) "Using Drive: 0 Partition: 3" - i386 specific

(7) OpenBSD FAQ

An open source enthusiast since 1994, Rafael Coninck Teigao has worked and played with Linux and *BSD and followed their evolution for almost 10 years. Currently getting his graduation degree in Computer Science from PUC-PR, Brazil, and running his company, SafeCore Network Solutions, Rafael still manages to find time to spend with his girlfriend in some calm and quiet place.


Discuss this article below.

newbie & partitions - john daniels
re: newbi - Tiro

newbie & partitions
john daniels - January 10, 2005 00:27:22
Why is it not possible to include a sheet with specific settings to partition a 20,30,40,60,80,120,160 et.c hard drive so a 63 year old,3-year inductee to the PC world can get an open source machine up and running before he dies. I speak a few languages (+or-) and have a thousand dollars worth of mags and books, but I am not yet nerdy enuf to try to put openBSD on this HP-120GB machine. I want to dual-boot and keep the WinXP, naturally. (I PAID for it.) I just bought "Point and click Linux" [Mepis Linux] and it too is scary, tho I've run the disc independently and it is amazing how much programming is available because of the heroic efforts of the Open Source community! I also have other computers running Win 95, 98& 98-2ndEd. I've got an old HP-Vectra Series 4 5/100 I know Nothing about, and Today I just got an IBM 486 unit which runs but has no OS. I have Red Hat 6.1 which would probably be good for that unit. I'm building a 1600 Duron/40Gig/256Mb PC which will get Red Hat 9.1 for the WHOLE HD: That I'm willing to take the chance on. The Win95 PC runs very satisfactorilly but won't run a printer, so I would really like to put freeBSD and 6.1 linux on it too, but I have no OS discs for it and I have yet to learn how to Copy an OS, if possible (I know it CAN be done,but..) so I also hesitate to screw it up. SO specific size drive mounting points/partitions and all that would make it possible for a lot more dummies like me to proceed into the Unix world sooner. Please help. BossOldman.

re: newbi
Tiro - September 13, 2007 19:48:38
If you can't figure out how to manage your BSD partitions, just use Debian. It will set them up for you automatically during the installation. Other than that, your post is a lot of rambling. I'm glad you are enthusiastic about the Open Source/Free Software movement. Just remember that those linux assholes are trying to steal your Freedom with the GPL.





Stop Spam Abuse: What operating system's CVS history begins in March 1993?

BSD Links

· Advocacy
· Drivers
· Events
· Flavours
· FAQs
· Guides
· Programming
· Security
· Software
· User Groups

September 16, 2013 11:24:31

Front | Information | Lists | Newsfeeds | Study Guide