Billix: a Sysadmin's Swiss Army Knife

Turn that spare USB stick into a sysadmin's dream with Billix.

Does anyone remember Linuxcare? Founded in 1998, Linuxcare was a company that provided support services for Linux users in corporate environments. I remember seeing Linuxcare at the first ever LinuxWorld conference in San Jose, and the thing I took away from that LinuxWorld was the Linuxcare Bootable Business Card (BBC). The BBC was a 50MB cut-down Linux distribution that fit on a business-card-size compact disc. I used that distribution to recover and repair quite a few machines, until the advent of Knoppix. I always loved the portability of that little CD though, and I missed it greatly until I stumbled across Damn Small Linux (DSL) one day.

After reading through the DSL Web site, I discovered that it was possible to run DSL off of a bootable USB key, and that old love for the Bootable Business Card was rekindled in a new way. It wasn't until I had a conversation with fellow sysadmin Kyle Rankin about the PXE boot environment he'd implemented, that I realized it might be possible to set up a USB key to do more than merely boot a recovery environment. Before long, I had added the CentOS and Ubuntu netinstalls to my little USB key. Not long after that, I was mentioning this in my favorite IRC channel, and one of the fellows in there suggested I put the code on SourceForge and call it Billix. I'd had a couple beers by then and thought it sounded like a great idea. In that instant, Billix was born.

Billix is an aggregation of many different tools that can be useful to system administrators, all compressed down to fit within a 256MB bootable USB thumbdrive. The 256MB size is not an arbitrary number; rather, it was chosen because USB thumbdrives are very inexpensive at that size (many companies now give them away as advertising gimmicks). This allows me to have many Billix keys lying around, just waiting to be used. Because the keys are cheap or free, I don't feel bad about leaving one in a server for a day or two. If your USB drive is larger than 256MB, you still can use it for its designed purpose—storing files. Billix doesn't hamper normal use of the USB drive in any way. There also is an ISO distribution of Billix if you want to burn a CD of it, but I feel it's not nearly as convenient as having it on a USB key.

The current Billix distribution (0.21 at the time of this writing) includes the following tools:

  • Damn Small Linux 4.2.5

  • Ubuntu 8.04 LTS netinstall

  • Ubuntu 7.10 netinstall

  • Ubuntu 6.06 LTS netinstall

  • Fedora 8 netinstall

  • CentOS 5.1 netinstall

  • CentOS 4.6 netinstall

  • Debian Etch netinstall

  • Debian Sarge netinstall

  • Memtest86 memory-checking utility

  • Ntpwd Windows password changing utility

  • DBAN disk wiper utility

So, with one USB key, a system administrator can recover or repair a machine, install one of eight different Linux distributions, test the memory in a system, get into a Windows machine with a lost password or wipe the disks of a machine before repurpose or disposal. In order to install any of the netinstall-based Linux distributions, a working Internet connection with DHCP is required, as the netinstall downloads the installation bits for each distribution on the fly from Internet-based mirrors.

Hopefully, you're excited to check out Billix. You simply can download the ISO version and burn it to a CD to get started, but the full utility of Billix really shines when you install it on a USB disk. Before you install it on a USB disk, you need to meet the following prerequisites:

  • 256MB or greater USB drive with FAT- or FAT32-based filesystem.

  • Internet connection with DHCP (for netinstalls only, not required for DSL, Windows password removal or disk wiping with DBAN).

  • install-mbr (part of the mbr package on Ubuntu or Debian, needed for some USB drives).

  • syslinux (from the syslinux package on Ubuntu or Debian, required to create the bootsector on the USB drive).

  • Your system must be capable of booting from USB devices (most have this ability if they're made after 2005).

To install the USB-based version of Billix, first check your drive. If that drive has the U3 Windows software on it, you may want to remove it to unlock all of the drive's capacity (see the Resources section for U3 removal utilities, which are typically Windows-based). Next, if your USB drive has data on it, back up the data. I cannot stress this enough. You will be making adjustments to the partition table of the USB drive, so backing up any data that already is on the key is critical. Download the latest version of Billix from the Sourceforge.net project page to your computer. Once the download is complete, untar the contents of the tarball to the root directory of your USB drive.

Now that the contents of the tarball are on your USB drive, you need to install a Master Boot Record (MBR) on the drive and set a bootsector on the drive. The Master Boot Record needs to be set up on the USB drive first. Issue a install-mbr -p1 <device> (where <device> is your USB drive, such as /dev/sdb). Warning: make sure that you get the device of the USB drive correct, or you run the risk of messing up the MBR on your system's boot device. The -p1 option tells install-mbr to set the first partition as active (that's the one that will contain the bootsector).

Next, the bootsector needs to be installed within the first partition. Run syslinux -s <device/partition> (where <device/partition> is the device and partition of the USB drive, such as /dev/sdb1). Warning: much like installing the MBR, installing the bootsector can be a dangerous operation if you run it on the wrong device, so take care and double-check your command line before pressing the Enter key.

Figure 1. The Billix Boot Menu

At this point, your USB drive can be unmounted safely, and you can test it out by booting from the USB drive. Once your system successfully boots from the USB drive, you should see a menu similar to the one shown in Figure 1. Simply choose the number for what you want to boot, run or install, and that distribution will spring into action. If you don't select a number, Damn Small Linux will boot automatically after 30 seconds.

______________________

Bill Childers is the Virtual Editor for Linux Journal. No one really knows what that means.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Billix and FreeBSD

Mario Guerra's picture

I wonder if booting a netinstall FreeBSD 7 is possible.

Yes indeed

Onno's picture

That would really be great!
I modified billix already to use full installation ISO's, but we also use FreeBSD installation so it would be really really great if we can also include those installation on the USB.
Thanks!

Billix - a linux super tool

Alireza Aghamohammadi's picture

This is a very good tool to have on a USB/flash drive. I'll give it a try.

Thanks
Alireza Aghamohammadi

needed options for Windows version of syslinux

cdharding's picture

while troubleshooting why my thumb drive wouldn't boot, I came across a forum post that was about installing
Ubuntu on a flash drive from windows, and there was mention of using the m and a options for syslinux if you were running it from Windows. It says it is not needed for the *nix version but is definitely needed for the Windows version. the post is here: http://jsco.org/dectop/

Syslinux

sigint's picture

Hello

I was extremely excited to read this article. I ran out and purchased a 512 Kingston DT games USB($9.99US), and get to
running this line >> syslinux -s {device},and syslinux is telling me that i don't have a valid FAT filesystem; when i do have a valid FAT filesystem. Where can i for help?

Have you tried reformatting

paulatthehug's picture

Have you tried reformatting it using 'mkfs.msdos' or 'mkfs.vfat'?

No valid FAT filesystem

systemansvarlig@vagaungdomsskule.no's picture

I have the same problem. Running Ubuntu 8.04 LTS, and have tried two different USB sticks, and both FAT16 and FAT32. syslinux will not recognise the file system, for some reason.

Lars Erik

Same problem

Cwolly's picture

I continue to have the same problem, and have not yet found a solid answer on how to fix it. when I run the install-mbr, it is doing something to the thumb drive that will not allow syslinux to see it as a valid partition anymore. I also get the "this doesn't look like a valid FAT filesystem" error.

Any help would be greatly appreciated.

billix and syslinux

mdeschane's picture

I was having the same problems; here are the steps I took that finally succeeded:

my USB device is sdc

cfdisk /dev/sdc; create partition and change type to FAT16
mkdosfs /dev/sdc1
mount -t msdos /dev/sdc1 /usbdrive (or where ever)
cd /usbdrive
cp billix-0.23.tar.gz
tar -zxvf billix-0.23.tar.gz (got a whole bunch of error messages "Cannot change ownership to uid 1000, gid 1000: Operation not permitted" even though I am root)
install-mbr -p1 /dev/sdc
cd ~
umount /usbdrive
syslinux -s /dev/sdc1

if you hold you mouth just right and clutch your favorite talisman firmly this should work.

permissions on fat16/32

linuxjnl's picture

FAT16/32 does not support file permissions. This is why you get the errors. These can be safely ignored.

ownership errors

cosmiclint's picture

I was getting the same errors. I think it's because of the way you mounted the drive. The UID and GID for /usbdrive would both be root, but I think the file wants be be untarred by a regular user.

When I included

-o uid=ubuntu,gid=root

in the mount command (I was using a live cd, so my username was ubuntu) then ran

tar -xzvf billix-0.23.tar.gz

as user ubuntu I didn't get the errors.

I've been able to boot dsl on a toshiba that supports booting from usb drive, but my Latitude doesn't make it past the menu.

Still playing with it, though and having a lot of fun. I routinely use live cds to fix borked windows boxes, so this is another handy tool.

Ownership errors

cosmiclint's picture

I should have added that I also copied the file in to the root of the drive as a regular user, so the file was also owned by user "ubuntu."

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix