Andrew J. Nelson
Published: 12 September 2008
Revised: 6 November 2010
This How To will explain partitioning and formatting a USB flash drive, and then installing Slax-6.0.7 onto that drive. The document covers methods for installing Slax onto either a Linux EXT3 partition or a Windows FAT32 partition from a Linux environment. It is intended to explain some general concepts and delve a bit deeper into the process than a simple "do this to make this happen" series of instructions.
The Slax clover leaf, straight from Tomas' slax.org.
Generally, this How To is for anyone needing basic instructions for accomplishing this task, and is geared towards those people new to the Linux world. While Slax 6.0.7 is no longer the current version, it is in the same generation and all the general principles should still apply.
First and foremost you will need a USB flash drive. As of this writing they are available everywhere from Wal-Mart to Newegg.com, and cost approximately $12 for a 2 GB drive, if you do a little comparison shopping. The minimum required size for this tutorial is 512 MB, although the original, un-modified Slax-6.0.7 can be shoe-horned onto a 256 MB stick. For all practical purposes, it is difficult to find a USB flash drive less than 1GB in size for sale any more.
The second requirement is a copy of the Slax-6.0.7 operating system. You can read about the basic Slax at slax.org. In addition to the basic version, there is another variant available for the purpose of this tutorial created by Andrew Nelson (me).
The third requirement is a PC running a Linux OS, such as Slackware 13.1 or Slax-6.0.7 from a CD on your own computer.
Last, while this How To does specify every needed command to complete the objective, it does not explain the usage for all of them. Explaining basic Linux commands is beyond the scope of this document.
This process involves both partitioning and formatting a drive. Please be very careful when you do so! A careless keystroke can result in the deletion of an entire drive that you had no intention of losing. I have done this! Again, be careful! WebGnuru takes no responsibility for any loss of data, hardware, time, or hair that may result from following the instructions in this How To.
You will be downloading a Slax version in a TAR format. TAR is a compression format, analogous to the Windows ZIP format. Saltwater Slax is intended as a portable web development platform. Below is a synopsis.
You can download my version here: webgnuru.com. The full README is also available in PDF.
The vanilla Slax-6.0.7 is avaiable here: slax.org
For simplicity, I recommend saving the download to your desktop. Once your download is complete, move on to the next step.
Back To The Top
From here on out I assume that you have a flash drive, the downloaded Slax tar file, and are sitting in front of a Linux computer. Lets get down to brass tacks.
Go to the command line or open a console session. Plug in your USB flash drive. If you are using a GUI, hit "cancel" when the "new medium detected" wizard pops up.
You will need to determine the drive designation. On the command line enter:
You will see output that says something similar to:
Your device designation is whatever is inside the brackets [ ], such as [sda], [sdb], [sdc] etc. (This stands for SCSI Device A, B, C etc.) Below is a screenshot of this process.
For the rest of this How To I use sdb as the drive designation and slax.tar as the filename. If your drive designation and/or filename is different, replace as needed!
We will partition the USB flash drive with FDISK. Once again go to the console.
Next create a new, primary partition. I recommend changing the partition type to FAT32 as this allows you to access your data from both Linux and Windows; if this is not relevant or important to you leave it as a Linux EXT3 partition type. Make the partition active. Print the partition table to make sure that everything is correct, then write the changes.
As a note, I have found that my Slax installs on flash drives seem to hold up on longer on a FAT32 filesystem. This may be due to the fact the ext3 is a journaling FS, which causes far more read/writes than what a flash drive is accustomed to.
Your USB flash drive has now been partitioned. If you are in a GUI, when this completes, the "new medium detected" wizard will pop up again. Once again, just hit cancel. Here is a screenshot of what your fdisk table could look like.
After the drive has been partitioned, the partition needs to be formatted. We will be doing this, again, from the command line. Please take notice that the device designation in these examples is sdb1 not sdb. The designation now means partition number 1 on SCSI device B.
In order to copy the TAR file to the formatted partition on the USB flash drive, the partition must first be mounted. This is a term which, when I was new to the Linux world, confused me. I did not exactly understand what mounting was.
Simply, mounting a device means attaching one file system to another. Your operating system is a file tree. One of the branches on that tree is the mnt/ directory. The USB flash drive is also a file tree; we will attach the USB file tree to the operating system file tree on the mnt/ "branch".
A good practice is to create a specific "twig" on the mnt/ "branch" for the USB file system to attach to. This is called creating a mount point. Let us return to the command line, create a mount point, and mount the USB flash drive's formatted partition to that point.
Next, we need to copy the TAR file to the mounted drive partition. If you downloaded the file to your desktop, as root, the command looks like this:
In order to install Slax, we need to extract the TAR file. Extracting a TAR file is analogous to unzipping a ZIP file. To do this from the command line:
After the extraction is complete, you should now see two directories: slax/ and boot/. The next step is to initialize the Master Boot Record (MBR), which Tomas (the creator of Slax) has made very easy by providing a script that does all the work.
Once you execute the script, follow the onscreen prompts. The process is very quick and easy. The next step is to remove the TAR file as it is no longer needed and is occupying quite a bit of space on your drive.
Finally, un-mount the partition. This is important! Yanking a USB flash drive out of the port without first un-mounting it can corrupt the file system on the drive. This can make your Slax install not work.
You should now have a bootable USB drive with Slax installed on it. To test, turn off your computer, insert the drive, and turn the computer back on. when you restart the computer, you must either select the USB flash drive as the boot device on the quick-boot menu or set it as the first boot device in the BIOS boot order.
I hope that this How To provided a clear and consise method for installing Slax onto a USB flash drive, in terms that are easily understandable for someone new to a Linux environment. If you have any questions, concerns, suggestions, or constructive criticism, please email me.