How to update your server's BIOS across the network

Posted by Tom Moertel Thu, 03 Mar 2011 22:45:00 GMT

Today at work, I had to upgrade the BIOS on some new Dell servers that had just arrived. (Dell, conveniently, shipped them with firmware six months’ out of date.)

Dell’s Linux-based BIOS updater, not entirely shockingly, didn’t work. After I had installed its prerequisites and let it run (repeatedly), it churned for a while and then gave up, offering only this:

The update failed to complete.

How helpful.

So, I decided to fall back to the tried-and-true option: the simple, DOS-based BIOS updater that Dell provides. The trick is that the updater does not contain DOS: You have to figure out how to get your servers to boot from a DOS floppy and then run the BIOS updater.

Did I mention that the servers lack floppy and CD-ROM drives?

Having been down this road before, I knew to get a FreeDOS disk image and then add the BIOS updater to it:

  1. Download the DOS-based firmware updater.
  2. Download a 2.88-MB FreeDOS floppy image with enough free space for the updater. (I used the dosdisk288.img image from the biosdisk project; see below.)
  3. Mount the image, copy the updater to it, and then unmount it. (See these instructions for more.)

Now I had a bootable floppy-disk image dosdisk288.img that contained the BIOS updater. Next, I needed some way to boot the system using that image. Since the servers had no floppy or CD-ROM drives, the next trick was making the image network-bootable.

For this, I used PXE and cobbler, an install server. We already run cobbler on provisioning servers sprinkled throughout our server farms, so it was easy to put the image on the network:

mv /tmp/dosdisk288.img /srv/dell-PER415-firmware/PER415-010203.img

cobbler distro add \
  --name=Dell-PER415-fw-010203 \
  --kernel=/usr/lib/syslinux/memdisk \
  --initrd=/srv/dell-PER415-firmware/PER415-010203.img

cobbler profile add \
   --name=Dell-PER415-fw-010203-installer \
   --distro=Dell-PER415-fw-010203

cobbler sync

The “distro add” command was where the magic happened. It told cobbler to create a fake Linux distribution whose kernel is memdisk and whose initrd is my floppy image. Memdisk is a special boot kernel designed to boot from a floppy image supplied as the initial ramdisk (initrd).

After the cobbler sync completed, I was able to boot the servers from the network by selecting the “Dell-PER415-fw-010203-installer” item from the PXE boot menu. A few moments later, I was at a DOS prompt. From there, I just ran the BIOS updater, and I was done!

For reference, here are the tools and documentation I used to accomplish my mission:

  • Ubuntu Dell BIOS – a handy page on the Ubuntu wiki discussing schemes for updating the BIOS on Dell systems
  • Dell biosdisk – an unofficial project at Dell for building bootable floppies and images for installing BIOS updates
  • MEMDISK module, part of SYSLINUX – it allows you to boot floppy and disk images from Linux bootloaders; it pretends to be a Linux kernel and boots the image given as its initrd kernel argument

Posted in
Tags , , , , , ,
3 comments
no trackbacks
Reddit Delicious

Two handy alternatives to the top command: htop and atop

Posted by Tom Moertel Thu, 10 Jun 2010 15:20:00 GMT

I recently started using two handy variants of top, the standard Unix tool for monitoring what’s going on with processes on a system.

The first, htop, uses ncurses to provide a more interactive process-viewing experience. You can surf through running processes, scrolling horizontally and vertically to reveal information that would otherwise have been clipped, information such as full command lines. Further, you can drive a cursor to select processes for commands like kill and lsof to act upon. Yes, you can see what files a process has open; you can even trace processes using strace. There’s also a handy tree view for understanding process ancestry.

The second top alternative, atop, offers more accurate accounting of processes and resource usage. It tracks all processes, even those that have lived out their brief lives between atop’s screen updates. This comprehensive accounting is helpful for understanding problems caused by herds of individually short-lived processes. With the old top, you might catch only a few of the processes in the act, but with atop, you can see the herd for what it is.

Two handy tools – check them out.

Posted in
Tags , , ,
1 comment
no trackbacks
Reddit Delicious

How to fix a broken bootloader configuration after a Fedora Linux upgrade

Posted by Tom Moertel Sun, 05 Jul 2009 16:42:00 GMT

It seems that every time I upgrade Fedora on one of my workstations, anaconda somehow manages to screw up the bootloader configuration, and when the upgrade is “complete” and the system reboots, I’m left starting at a GRUB prompt. So this is a little note to myself for how to fix the broken configuration. (If you find my note helpful, great, but if you try anything in it, you do so at your own risk.)

First, find out where GRUB thinks the /boot partition is:

grub> find /grub/grub.conf
find /grub/grub.conf
 (hd0,0)
 (hd1,0)

Here, GRUB found two potential /boot partitions, which is actually correct because I keep /boot on a RAID-1 md device and GRUB is finding the device’s underlying partitions.

Next, tell GRUB to use the desired /boot partition as its root device:

grub> root (hd0,0)
root (hd0,0)
 Filesystem type is ext2fs, partition type 0xfd

Finally, tell GRUB to set itself up on the hard drive that contains the partition (which, for my workstations, is the correct place):

grub> setup (hd0)

That’s it, all done.

At this point, you can tell GRUB to “boot” using the configuration or “reboot” from scratch to test the configuration from a system restart.

Posted in
Tags , , , , , ,
1 comment
no trackbacks
Reddit Delicious

How to flash your BIOS when you don't have a floppy drive

Posted by Tom Moertel Fri, 17 Feb 2006 07:23:00 GMT

Tonight while building a new workstation, I needed to update the BIOS on the motherboard, a Tyan Tomcat K8E. Tyan, however, offers only floppy-based BIOS flashing software to do the job. Worse, the software requires me to boot into DOS first, using a DOS boot floppy that is neither provided nor lying around the office (I’m a Linux guy).

One more thing: it turns out that my new floppy drive is junk.

Thus we arrive at tonight’s problem: If you do not have a floppy drive, how can you flash a motherboard’s BIOS when its manufacturer provides only a DOS-floppy-based BIOS flasher?

Fortunately, the problem can be solved. In case you ever need the solution, here it is.

Disclaimer: This recipe worked fine for me, but might not for you. If you follow these instructions, you do so at your own risk and assume all responsibility for whatever happens, even if your computer catches on fire or your pants explode. You have been warned.

First, download a bootable floppy image from the FreeDOS Project. The one you want is the 2.88-MB ODIN image because it has about 1.5 MB of free space, enough to hold the contents of the BIOS flasher’s floppy.

Second, mount the floppy image so that you can edit it:

mkdir /tmp/image
mount -o loop /path/to/odin2880.img /tmp/image

Third, copy the BIOS flasher and associated files into the mounted floppy image. I just unziped Tyan’s archive directly into the image:

unzip /tmp/tyan_2865_301.zip -d /tmp/image

Fourth, unmount the image.

umount -d /tmp/image

Fifth, create a bootable CD-ROM from the floppy image.

cd /tmp
mkdir boot_cd
mv /path/to/odin2880.img boot_cd
mkisofs -o odin-cdrom.img -b odin2880.img -c boot.catalog boot_cd
cdrecord -v -eject odin-cdrom.img

Finally, reboot your PC using the CD-ROM and flash away! (Note: If FreeDOS asks, you don’t want to use extended memory or anything like that because BIOS flashers don’t like it. You want old 8086-style unprotected memory.)

Update 2011-03-03. For a somewhat more up-to-date recipe that also lets you boot your BIOS updater across the network see: How to update your server’s BIOS across the network.

Update 2011-02-12. It looks like the link I gave to the ODIN image is now dead. Instead, try the BALDER image.

Posted in ,
Tags , , ,
no comments
no trackbacks
Reddit Delicious