BSD Bootloader ‘Read Error’

As part of my home network, I have been using an HP Vectra VL5/166 Series 5 DT Pentium 166 MHz computer as my NAT router for several years now. I used IPCop (Linux-based) since its 1.3 release, followed by 1.4 for quite a while, and then decided I should give m0n0wall (BSD-based) a try, starting at the 1.2b9 release. m0n0wall was originally designed to run on embedded / SBC systems, especially Soekris boards, which boot off a CF card. It was later [easily] adapted to run on generic PCs, though there’s no real method provided to install it, other than performing a ~5 MiB disk image copy to the hard drive. I tried this (using Knoppix textmode, wget the image, then dd), but was plagued by a Read error after loading the BIOS. I worked on trying to fix this for quite a while, to no avail. Eventually I conceded defeat and just used the m0n0wall LiveCD to boot the system, and stored the configuration on a floppy disk. I later experimented with pfSense very briefly, which is a modification of m0n0wall with a somewhat different target audience and different goals in mind. Of particular interest to me was the fact that after booting from the LiveCD, it provides an actual [optional] installer, which I hoped would avoid the problems I ran into with m0n0wall. Long story short, after about 6 attempted installs, it still didn’t work, so once again, I conceded defeat, and kept on truckin’ with the m0n0wall LiveCD.

Fast forward about five months…

m0n0wall (1.2b9, LiveCD + floppy for config) was very stable … no lockups or reboots (planned or unplanned) for the whole time. One night, I decided to reboot all my computers including the m0n0wall router. Anyway, after it booted back up, it was acting strange … and then started telling me errors like no XML object found, etc. I pulled out the floppy disk, and checked it in my desktop, which spent about 10 minutes trying to read the ~12 KiB file, and later chkdisk confirmed that there were 512 bytes in bad sectors. Crap. Rather than just rebuilding my configuration, though, I decided to go all out and try the new pfSense Beta (finally out of alpha), which put me back in the situation of fixing the Read error once the system actually hit the BSD bootloader.

Read error THIS, bitches!

I googled briefly, and came across a page Why does FreeBSD’s boot loader display Read error and stop after the BIOS screen? Well, that seemed to capture the essense of my problem fairly well, so I gave it a go. There was some confusion to this issue, though, as my BIOS initially reported the disk was 16,383 cylinders, whereas the BSD bootloader installer [correctly] recognized that it was 39,703 cylinders. I tried various combinations of either using the BIOS’s wrong value in the bootloader installer, or entering the right value in the bios and bootloader, or entering a third value in both (somewhere between what the BIOS thought and what the hard drive thought); none of these approaches worked. I also tried most of these combinations without the default ‘packet mode’ selected when installing the bootloader; again, no success. I even tried partitioning the disk into ~1 GiB partitions, in case the issue was with using a partition sized greater than a 32bit address; still no luck. Eventually, I pulled out my trusty Ultimate Boot CD (UBCD), and started going through the boot loaders provided on there. I didn’t make it through the whole list, because when I got to GAG, I was easily able to go into setup -> add operating system -> select FreeBSD from the list and name it/pick an icon, then configure Boot timer to ~2 seconds (so that it will boot without my interaction, since the router is almost always headless / keyboardless), and pick the OS that I just added as the default choice. Lastly, selecting Save in Hard disk immediately installed the bootloader to the drive, and I was able to boot like a charm! It’s frustrating how quickly and easily GAG worked after I spent hours trying more complicated solutions…

Anyway, I’m glad it works. I’ve mostly reconfigured my router with pfSense installed to the hard drive now, and it seems to be working fairly well. I haven’t checked out the Beta1 known bugs yet, but the first bug I’ve observed seems too obvious to even imagine someone hasn’t posted. I guess the pfSense logo is set as a background image (css, presumably … I haven’t actually looked at the code), so they use a transparent image statically placed above it for the actual linking (to the main page). For me, this image (http://arvin.local:446/themes/pfsense/images/transparent.gif) is missing (404 – Not Found) in each of the three themes provided with pfSense, so I get a nice little rectangle with the word Transparent (the alt text) above the pfSense logo. Aside from that, everything else has been sweet like candy. There’s rumor that I can even get more info than just traffic stats from SNMP (for use on my cacti box), but I haven’t looked into that very much yet. Anyway, I hope this can help someone else with a similar problem to mine. I don’t just write these technical posts because I like to regale myself with stories of grueling troubleshooting and frustration ;). Good luck, and have fun.

3 Responses to “BSD Bootloader ‘Read Error’”

  1. Oscar Steenmann Says:

    Hello, I experienced the same issue with an HP NetServer LC 2000r, but your solution solved the problem! Many thanks.

  2. John Says:

    Hi.

    Regarding the first part of the story, if you need to get a m0n0wall image to hard disk, this worked for me.

    http://www.m0n0.ch/wall/physdiskwrite.php

    It will overwrite the h.d. you tell it to install m0n0 on, but it does allow disk selection, and will ask for a confirmation before proceeding.

  3. Hakim Says:

    I am getting to the boot loader, but I am getting some type of endless loop. Pfsense is not booting up.

Leave a Reply