More FreeBSD Stuff

I’m going to talk about setting up a laptop computer to boot and run FreeBSD from an external USB 2.0 attached hard drive. So far, this is working pretty nicely.

The office laptop hard drive broke down, so I’ve been doing a bunch of re-installation of stuff. For the office crew, it’s a given that we will be running Microsoft Windows XP as the operating system. But while I was waiting for the replacement drive to show up, I looked up “FreeBSD” and the laptop model via Google, and found a handy page listing the various drivers that FreeBSD would need to make use of the laptop resources. So I gave that a try using one of the 2.5″ IDE drives that we have stored from laptop upgrades past. Except for the Broadcom-based onboard WiFi device, everything worked nicely.

Then the replacement drive showed up, so it was time to do the XP re-install on that. One of the things I had noticed, though, was that the BIOS boot menu had an option for booting from a USB device. Hmmm.

So I moved my laptop hard disk into a 2.5″ external USB 2.o drive enclosure, the sort that draws its power from the USB port itself. I put in the FreeBSD 6.1-RELEASE install CD-ROM, and booted the laptop to CD. This gave me the option of installing FreeBSD to either the onboard hard disk or the USB hard disk. I selected the USB disk and proceeded with a express install for the “User with kernel sources” distribution.

My hard drive is about 40GB in size. I chose to use 15GB for the FreeBSD installation, leaving about 23GB for a FAT32 partition. I can mount a FAT32 partition read/write from either FreeBSD or Windows, so if I keep my data files on that partition, then I have the functionality of a decent-sized external disk for that purpose. This is where I will put documents, saved web pages, PowerPoint presentations, and so forth. But for the OS, once I allocated space for the root, “var”, “tmp”, and swap partitions, I had about 11GB of space for the “usr”, the one where applications get installed. I’ve amended the “fstab” file so that the FAT32 partition gets mounted at system startup.

I did something a bit different from my usual installation after the base system was installed. I used the FreeBSD “packages” system, which loads on pre-compiled binaries of selected applications. I usually use the “ports” system, but I didn’t feel like I had room to store the various downloaded sources for the applications. This is a bit of an experiment.

As I mentioned, I hadn’t been able to get the onboard WiFi to work on the previous try. I had no better luck with it this time, even with direct access to the Windows driver and using the “NDISulate” procedure. In looking for information, I discovered that FreeBSD 6.x has builtin support for Atheros-based WiFi cards, so I looked around and found a DWL-G630 card that wasn’t in use. I inserted it in the PCMCIA slot, typed in “ifconfig ath0” at the prompt, and immediately the card was recognized. I visited “sysinstall” to set up the interface to use DHCP. It found my wireless router with no trouble. I was now free of the CAT-5 network cable, which was a nice advance.

I had the “xorg.conf” configuration file from the previous install, so I put that in place and tried “startx”. It trundled, then said that there were no available screens. Huh? Then I remembered that there was another step the previous time: install the video driver. After that, X11 came right up, displaying the usual ugly checkerboard in the background. Another visit to the “packages” got me the Fluxbox window manager, a nice lightweight window management system. I put an “xterm” and “fluxbox” into my .xinitrc file, and “startx” brought up Fluxbox fine that time.

Right now, I have a slew of packages tagged for installation, including “Gaim” for instant messaging, “OpenOffice 2” for documents, spreadsheets, and presentations, a variety of file managers for X11, “LaTeX” for document typesetting, “XEmacs 21” for all sorts of text editing tasks, “Scribus” for desktop publishing, and various programming languages and utilities.

I intend to leave the FreeBSD with a pretty generic kernel and also to have it boot to the regular console interface. The idea will be that this disk will be my usual interface to the office laptop, and can also go with me anywhere. Whenever I need to use some other machine, though, I can boot FreeBSD if it has a BIOS option to boot to USB device. This I expect will be useful for diagnosing other machines as well as letting me use a familiar setup in unfamiliar places. I need to check into how tough it is to set up XOrg for other systems. More about this later.

Update: I ran into a bit of a gotcha: just mounting the FAT32 partition as read/write under FreeBSD left it with the default of being owned by root, which meant that my user account could not write files to it. The fix? I changed my /etc/fstab entry for it to read:

/dev/da0s2 /mnt/fat msdos rw,-u=1001,-g=0 2 2

My user account is in the superuser group. If that doesn’t hold for yours, the group number would match the user number.

I’ve also worked out getting the SVGA output on the laptop to work with XOrg and tested it for use with “impress”, the OpenOffice presentation package that parallels Microsoft’s PowerPoint. I can view DVDs, even those with menus, using “ogle”. There’s a reasonable MP3 player in “beep-media-player”. I haven’t located a GUI-based mixer package yet, but “mixer 50” from a shell prompt sets the sound level to half-volume. Even with the package-install-fest yesterday, I’ve still only used a third of my available space for applications and user data under FreeBSD, and there is still virtually the entire FAT32 partition to use yet.

Wesley R. Elsberry

Falconer. Interdisciplinary researcher: biology and computer science. Data scientist in real estate and econometrics. Blogger. Speaker. Photographer. Husband. Christian. Activist.

2 thoughts on “More FreeBSD Stuff

  • 2006/05/30 at 6:13 pm

    I used to have Fedora (from Red Hat) on my computer and loved it. The load time was spectacular. Loading the computer was only comparable to Windows (a little faster, I believe), but the loading of applications was much, much better. and the computer never gets busy and slows down.

    The reason I don’t still use it is 1) compatibility issues with hardware. I think this can vary depending on which unix-like package you pick, but I had some issues. Some of them I was able to resolve, but it took me a lot of work to do so. Some of them I wasn’t, and I’m pretty sure it just wasn’t going to happen. Also there is a problem of installing anything as being a major pain. If it’s not available as RPMs it’s almost worthless to even try. I don’t know how many times I tried to compile something and I found out it needed dependencies. Then those dependencies needed dependencies and so forth towards infinite regression. Nevertheless, there was always some problem and my experience of successful compiles was like 10%.

  • 2006/05/31 at 1:07 pm

    My experience with the FreeBSD ports system, which compiles applications from source, is that is is uncommon for an up-to-date port to fail to compile, install, and run. The ports system automatically figures out the dependencies and will install those, too.

    Back in 1993, I plugged Linux on my bulletin board as a capable Unix for the i386 architecture. I still have a Linux 0.95a floppy disk boot set. So in 1996, when i wanted to set up a server of my own at TAMUG, I naturally got the latest Linux and tried to make it go. It just didn’t happen. My friend Marc sent me a FreeBSD 2.1.5 install disk. Within two hours, I had a fully installed and working system, with email and web server running.That was an eye opener.

Comments are closed.