Saturday, October 28, 2006

Canned OS on a Stick! Boot Slax Linux from USB Flash Drive.

Here's a walk-through for how you can boot Slax Linux from your USB stick. For these instructions, I will assume that you have Windows since that's the market-dominant OS. When you're done, you'll have a USB flash drive that has Linux, KDE, and Firefox. Plus, you can still use the USB flash drive to store files like you normally would because the USB flash drive is formatted with the FAT32 filesystem.

For this to all work, you'll need a USB flash drive that's at least 256MB. The bigger, the better. Your computer must also be able to boot from USB hard disk. Usually, there is a BIOS setting that you need to enable.

Now, you need to download the stuff that you need. First, download the Slax Standard Edition ISO from the Slax website. While you're there, also download the Mozilla Firefox 2.0 module. For the adventurous, you can try doing this with the other Slax editions also.

After you download the ISO image, burn it onto a CD. Alternatively, you can mount the iso with a virtual cd program such as Daemon Tools, Virtual CD, Winimage or some other equivalent. You just need to be able to copy the files off of the CD.

Next, create a folder on your Windows computer. For this example, I will create a folder named
c:\slaxusb. We'll call this the remaster directory.

Then, copy all of the files on the CD to your remaster directory. Copy the Mozilla Firefox 2.0 module to the modules folder in your remaster directory. In my example, that would be the c:\slaxusb\modules directory. When you're done it will look sort of like this. Now edit the syslinux.cfg file that's located in the tools\WIN subdirectory in your remaster subdirectory. For me, that's the C:\slaxusb\tools\WIN directory. Find the line that starts with "append". It's probably the last line. Add autoexec=xconf;startx to the end of this line. This will make the USB stick automatically boot into KDE.

Go to My Computer, right-click on the removable disk icon for your USB Flash Drive, and select Format. Now format your USB flash drive with FAT32 filesystem. Note the drive letter of your USB flash drive.

After the drive is formatted, open up a command prompt, switch to your remaster directory, and run make_disk.bat followed by the drive letter of your USB flash drive. Here are the command prompt commands to run:
cd c:\slaxusb
make_disk g:
Remember to use substitute g: with the drive letter for your USB Flash drive. When the script finishes executing, you'll see a screen that looks like this.

That's it! You're done. Now you have a USB flash drive that can boot Linux. Just insert your USB Flash drive in a USB port, configure your computer to boot from USB, and power on your computer.


Vagmi said...

Great blog post. Got my SLAX working in a jiffy on my pen drive. But my Acer TravelMate 2420 laptop with PhoenixBIOS version 4 release 6 does not support booting from a USB drive. We badly need an open source BIOS implementation.

rxhui said...

Thanks for the feedback and I'm glad you found it useful.

Eric said...

That is quite simply awesome.

Thanks for the info! :)

Daniel said...

vagmi: You dont necessarily need an open source bios implementation.

There is a boot floppy that can boot an ide cdrom even on an old 486 with absolutely no kind of atapi support whatsoever.

If that is possible, then I would guess booting usb in this fashion would be possible as well.

For the boot floppy I was talking about:

Davor said...

Not work , possible because my laptop is DELL:)