How-to install OpenBSD on a Libretto
Summary: This is a How-to document that I put together while installing OpenBSD 2.9 on a Toshiba Libretto 50CT. It walks you through preparations, the actual install, and post-install issues. The final result being a secure unix server with an extremely small footprint.
Goals for this installation
Why would you want to install OpenBSD on a machine like the Toshiba Libretto? Personally I had a few goals when I started, that is except from the fact that I had a machine to spare that otherwise just would have collected dust on a shelf somewhere. Anyway, these were my primary goals:
- Install OpenBSD as the only OS on the machine
- Run python
- Run apache preferably with mod_python
- Log router/firewall logs from my Netgear router on the host
What I was aiming for was a minimal server which I could use to test python CGI scripting. Since I have a Netgear router to filter my internet connection, provide NAT and DHCP services, I wanted somewhere to put the syslog output generated when someone violates the filter rules. The Libretto could provide both these services.
Preparations
You do not do this kind of installation without some preparations. Installing a non-Microsoft OS on a laptop, which are always Windows centered, usually requires a pretty thorough knowledge of the hardware involved. Knowing your BIOS settings, the make of your hard drive, graphics card, and network card can be the difference between a fairly quick install and a long troublesome experience. Here are some useful things to know before you begin:
-
A list of the hardware in your machine
If you have a 50CT you can look at the pdf spec sheet by using the link on the right. Otherwise you can go to the support section at Toshiba USA and get the appropriate spec sheet there. This pdf does not show disk geometry though, that I found by searching the Internet for the model and make of the disk, the Toshiba MK0803MAT drive. If you still have the original documentation you can look there of course. Here's a summary for my machine:Toshiba Libretto 50CT Resource Comment Cpu Intel Pentium 75 Mhz Memory size 32 Mb BIOS PnP 1.0a support, apm 1.2, vesa 2.0, dpms, dcc
Latest version 6.60
To enter the BIOS during start-up press the ESC-key while switching power on.Sound Yamaha OPL3+SA2, 16bit stereo, SoundBlaster Pro, Midi Disk Size 772 MB (NB! See below for APM, don't use above 736 MB)
Geometry
- sector size = 512 blocks/sector
- sectors/track = 63
- tracks/cylinder = 16 (heads)
- total number of cylinders = 1580
Graphics card Chips & Technology B65550 with 1 MB memory
Internal resolution
- 640x480x16.7M colors
- 800x600x64K colors (virtual display)
- 1024x768x256 colors (virtual display)
- 1280x1024x16 colors (virtual display)
Network card 3Com Etherlink III, 3C562D/3C563D Network info IP-adress 192.168.168.50 ;-)
Netmask 255.255.255.0
Default gateway 192.168.168.1
DNS servers 193.150.195.21, 212.186.255.130 -
Check the internet for previous experience
This is always a smart thing to do since it may save you a lot of grief when starting your own installation. This document, when finished, is an example of this. Actual experience of installing OpenBSD on this specific hardware.- APM works but you need to be careful not to use the last 32meg or so of the disk since that's where the BIOS dumps the long time hibernation image. You can take a look at the bios geometry in disklabel to see exactly how many sectors it wants. Failure to do so will cause filesystem corruption during suspend.
-
The libretto uses a single IRQ for both sb(4) and wss
so the best thing to do is to choose one and disable
the other in the kernel.
It is not always necessary to recompile the kernel if only configuration changes are required. See config(8) on how you can change the device configuration in the kernel file directly:
# config -e -o bsd.new /bsd
OpenBSD 2.7-beta (GENERIC.rz0) #0: Mon Oct 4 03:57:22 MEST 1999
root@winona:/usr/src/sys/arch/pmax/compile/GENERIC.rz0
Enter 'help' for information
ukc> disable wss
uck> quit
- The PCMCIA external floppy drive is not currently supported by OpenBSD, but it can be used during the install.
- Installation can be a bit tricky with only a single PCMCIA slot. The best way to do this is to do a network install. To do this, load the boot floppy and at the boot prompt, enter boot -c. When you see the UKC prompt, unplug the floppy drive, plug in your network card, and then type exit. The kernel will then probe the network card and you should be able to do a normal network install. You may find it necessary to disable the sound devices in the BIOS in order for the boot floppy to correctly detect your network card.
-
I have a swedish keyboard, but during install it's US
so here are a few useful keyboard mappings.
You press You get + - _ ? - / - Determine what to install. Read the OpenBSD FAQ 4.0 Installation Guide to determine your installation needs and the space requirements associated with this.
-
How should I size my partitions and how many do I need?
In the Quick Install Instructions that come with
the CD, and in the OpenBSD FAQ 4.3 they
recommend sizes and what partitions to create.
Full system install
File system reqs
Mount point Size (MB) / 40 MB swap 32 MB /tmp 32 MB /usr 450 MB /var 80 MB /home 102 MB sum 736 MB The above is my decision based on recommendations in the OpenBSD documentation and FAQ. Amended based on my disk size, I decided to give the end of the disk lots of space in order not to interfere with APM. If you want every byte to count you have to research this further and be more exact. I increased the size of /usr and /var to make room for apache, python, more logs etc. The /home partition is rather large for a single user development machine but I do need somewhere to place my python projects don't I?
Pre-install issues
Before I started the Libretto dual-booted between Windows 95 and Slackware 6.0. The network card a 3Com PCMCIA card was supported according to the OpenBSD web site.
I also had I Dell laptop running Windows 2000 which I was going to use as the network install point, for this purpose it was running War-ftpd. Most hosts on the network use DHCP but since the Libretto was going to be used as a server it would get a permanent ip-adress.
-
Updating BIOS
Download the latest version 6.60 (for 50CT), unzip and install to a diskette.Boot from this diskette on the Libretto and follow the instructions.
From the BIOS update readme:
During the upgrading of your computers BIOS, if the computer loses power or fails to complete the process of upgrading the BIOS, the existing BIOS in the computer may become damaged. In the event of this occurring, the F12 Installation Method, described below, can be used to recover from this error condition.
It is recommended that all PCMCIA cards be removed from the system prior to upgrading the BIOS. Also advisable is removing the computer from an attached DeskStation V or DeskStation V Plus or NoteDock Enhanced Port Replicator.
It is not unusual to see a CMOS error when you first reboot the computer after installing the new BIOS. If you see this message on your screen, press F1 as instructed. This displays the "TSETUP" screen. Press <End> to save the CMOS data. You won't see the CMOS error again.
The F12 Installation Method requires a 720 kb diskette, a high-density will not work!
-
Create a bootable diskette
This was done on the Dell from a command prompt with the OpenBSD CD loaded. We use the floppy boot image.C:\> cd d:\2.9\i386
C:\> ..\tools\ntrw floppy29.fs a:
3.5", 1.44MB, 512 bytes/sector
bufsize is 9216
1474560 bytes written
Now we have a diskette to boot from and use during the OS install. It may be necessary to disable sound in BIOS to get the diskette/network card swap to work. See Preparations above on how to enter BIOS setup at machine power on.
Starting the OS install
What follows is a step-by-step account of the actual installation. Problems encountered, solutions found, log output, comments, and hints. Perhaps I could have summarized this and only related the most important stuff. But I feel that this complete account does a better job of showing what can be expected during an install.
- BIOS upgrade went without a hitch.
- Entered BIOS and disabled the closed lid alarm.
- After OpenBSD is installed you can shave some time of the boot process by entering the BIOS again and change boot order to hdd-fdd since OpenBSD doesn't support the diskette drive anyway.
- Sound is still on, so sb and wss use the same irq at the moment.
On the first try, boot diskette fails to load. I suspect defective disk, got this:
booting fd0a:/bsd: 1302528+1875968 failed(5). will try
/obsd
obsd failed(2). will try /bsd.old
bsd.old failed(2). will try /bsd
Above repeated once, then timeout. Created a new boot
diskette and rebooted - got the (I)nstall, (U)pgrade or
(S)hell?
prompt. Misunderstood the info on swapping
diskette drive and network card. This should be done
immediately when you get the first boot prompt, i.e.
reading boot.......
probing: pc0 com0 com1 apm mem[639K 31M a20=on]
disk: fd0 hd0
>> OpenBSD/i386 BOOT 1.26
boot> boot -c
I realised my error when I started to get questions about configuring the network, had to reboot again...
Now I saw that the kernel identified my network card! Back
at the (I)nstall, (U)pgrade or (S)hell?
prompt.
When I got to the Install from (f)tp, h(ttp)...
prompt everything looked OK. Then I ran into some problems. The
files on the CD were presented as all UPPERCASE when I tried to
use ftp. My Win2k ftp server had no options to change this(but
it did present unix like paths).
Searched Nonags for a free file rename utility, choose Flash
Renamer 3.0, copied CD\2.9\I386 to a simulated
/pub/OpenBSD/2.9/i386 directory and renamed all files to lower
case. Tried again at the Install from (f)tp...
prompt
This time it worked! Installed everything except game. Being on a local 10 Mbit network retrieving base29.tgz took one minute and 48 seconds.
Encounter weird problem when getting xshare29.tgz:
gzip: stdin unexpected end of file
tar: end of archive volume 1 reached
tar: sorry, unable to determine archive format
Reselected it and tried again, same error. Looked at the file on the Win2k box and the file is zero bytes! Check the CD, file is zero bytes there as well! Try the Internet, get it from Sunet, there it's 1,69 MB. Using Winzip on the Win2k box I can browse the file, should work now - and it does!
Choose MET as my time zone. Finally I get this:
CONGRATULATIONS! You have successfully installed
OpenBSD! To boot the
installed system, enter halt at the command prompt. Once the
system has
halted, reset the machine and boot from the disk.
I do # reboot
Looking for PCMCIA diskette drive takes a looong time, don't forget to disable that in BIOS! Generating host keys for ssh takes a while as well. Finally I get the login prompt, date and time are incorrect, but it's OpenBSD alright. Two and a half hours of work and the time is 1.24am, time to get some sleep!
How are things holding up?
Things doesn't always turn out as planned. Since I started running OpenBSD on my Libretto its only function has been to receive router/firewall logs. This has worked without a hitch, in fact I was nearing a years uninterrupted service when the machine stopped. When I investigated it turned out that I had managed to pull the power cord on the libretto when installing my new print server (my server box is extremely crowded). Restoring power proved that the apm services had shut down the box when the battery charge went critical and everything started normally when plugged in again, impressive! Due to my own mistake the libretto only managed a total uptime of 341 days. Proving that my misgivings about the pcmcia network card not standing up to the heat generated was incorrect.
What else, there has been some funny sounds from the hard disk on some occasions but nothing major. As a single function server it does its job extremely well requiring no maintenance (except for analyzing the firewall logs of course). The libretto is working much better than expected admittedly doing a little less than I had planned initially.