openbsd installation
The OpenBSD installation is simple and quick. It is also highly documented so I wont cover everything here but just note a few things that may be of interest to you during install.
Running a Snapshot
I will be installing a snapshot of OpenBSD (currently 4.5-BETA) as there are some changes to xorg and and some packages that I'm interested in testing and using. If you are using this as a desktop or laptop, I think its the best thing to run. The OpenBSD devs aren't really in to breaking the source tree and they provide snapshot sets that make it just as easy to run a snapshot as it is to run a release.
Choose a Mirror and Download
If you like OpenBSD, buy a CD set or make a donation. If you want to get moving right now without a CD set or you have an older CD set then you will need to pick an OpenBSD FTP mirror. This is used during the installation and for installing packages on your system. Take a second to pick one close to you. It helps you and OpenBSD. The main site is capped, don't use it.
I use rt.fm in Illinois, and will use it in my examples. Thanks to Joshua.
Grab an iso image for installation. Goto /pub/OpenBSD/snapshots/i386/ on your mirror and grab cd45.iso or install45.iso. The former is an FTP installation image where you will download your sets and the latter is a full install image with the sets in it.
Burn it do a disk and lets go!
USB Installation
My laptop doesn't have a CD drive so I have to install OpenBSD to USB Stick and then install to the Laptop. Skip this section if you have a CD Drive. Fortunately I have a second laptop. You can just run the installer and use the USB Stick as the harddrive you are installing it to. Just use the entire drive for that install and the only set that you will need is bsd.rd. Thats it. Nothing else. Once you install to your thumb drive, you can proceed to a normal installation by booting from the USB stick and running the following from the boot prompt:
bsd> boot bsd.rd
Installation Routine
Once you have booted off your preferred image and you are at the (I)nstall, (U)pdate, (S)hell prompt just choose (S)hell so see how much memory you have so we can size the sleep/hibernation partition properly. From the console run:
# dmesg | grep real
this should give you the amount of real mem you have. Remember how many MB is being reported. Your sleep/hibernation partition needs to be (real mem + 2MB). Return to the install by running
# install
Choose no when asked to have OpenBSD use the entire disk. We need 2 MBR partitions to accommodate proper sleep/hibernation functions. NOTE: We will be using the entire disk between both of these MBR partitions. All data will be destroyed. Make sure you backups are current! Personally I just disable all used partitions first by running:
fdisk:*1> edit 0
Obviously replace 0 with you partition number. Then just choose 0 to disable it. Once they are all disabled create 2 partitions:
MBR Partitions
- Partition: 0 - Type: 16 - Size: (real mem + 2)MB - Offset: 63
- Partition: 1 - Type: A6 - Size * - Offset: (63 + size of partition
- Flag Partition 1 as bootable
OpenBSD Partitions
- a: / 128M
- b: swap 512M
- c: entire disk. Ignore.
- d: /tmp 512M
- e: /var 2G
- f: /usr all remaining space
- i: 1st MBR partition. Ignore
I don't create a partition for /home because I symlink /usr/home -> /home. This way I dont have to guess up front about the sizes of the partitions only to be wrong down the road. It is still recommended to have separate partitions for /, /tmp and /var partitions as different sets of security are applied to them.
You will definitely want to configure the network if you will be installing the sets via FTP. Even if you aren't, its easier to just set it up now. Once you have configured the network to your liking just enter your root password and choose ftp or cd when asked for the location of the sets, depending on the image you downloaded. For FTP choose your mirror from the list. When asked for server directory enter in:
pub/OpenBSD/snapshots/i386
I choose all sets except for bsd.mp as I don't need it. Choose what is appropriate for you and then install them. After the sets are installed I disable sshd and ntpd. I don't need sshd running on a laptop. If it were my desktop I would enable it. Finish up the install and you'll get dropped to a prompt. Since we didn't choose to use the entire disk for the installation the installer didn't update the MBR with OpenBSD's boot loader. To do this just run the following, choosing yes to the question and then halt the system.
# fdisk -u wd0
# halt
Once the system is halted just reboot off of the hard disk and that it.