
Looking for a fast, portable and affordable operating system?
I was and i found the solution in Slax. Slax is a member of the Linux flavour of operating systems which means it is stable and free. The creators name is Tomas M and he developed a set of scripts that turns your favourite distro into a portable OS that can be loaded onto a portable USB Flash Key, MP3 Player, Camera or even from a hard drive and run directly from it. Toams M created Slax from another Linux derivative called Slackware and the result is a lightning fast system that boots from portable media.
Slackware had always been my distro of choice and while it is probably not for the linux beginner i have found it to be the most stable and customizable flavour of linux around. The birth of Slax meant that i could now carry my OS in my wallet, and use it on any computer by plugging the flash drive in and booting.
IT IS FAST
The option to load Slax into RAM results in a freakishly fast system that has almost all the functionality of a fully fledged Slackware install and twice the speed. Even when Slax is loaded from a flash device or locally from your hard drive it is still very fast and around 30 seconds after pushing the power button you are ready to go.
IT IS PORTABLE
Slax is stored in a squashed format resulting in an LZMA file which decompresses very quickly. While stored it weighs in at under 200Mb making it a lightweight contender with the speed of a cat. This is accomplished by stripping down the full slackware install to a bare minimum which is quite a feat. The downside of this is Slax is missing some functionality (like wireless out of the box) on some systems as not all hardware is recognized. Thankfully though, due to recent inactivity of the author, a community version has sprung forth which is being maintained by a super user called Fanthom who has painstakingly produced a more compatible version that is more widely compatible with a majority of systems. He is currently developing a 64-bit version of Slax which is a great leap forward for the evolution of Slax.
IT IS MODULAR
Another nice feature of Slax is the modular design. Unlike other distros where one has a package manager that connects the internet and downloads a package (program), slax uses modules. These are pre compiled packages that you activate and deactivate. The traditional 'installation' of a program is now redundant as by simply double clicking on a module, causes it to be mounted and injected into the file system ready for use. This happens in a fraction of a second and the application is ready for use. Double click on it again and the module is deactivated and removed from the system. This means that you are only using a program as you need it, and the system is not bogged down with thousands of files that are rarely used. Modules can be activated directly from the slax website, or downloaded and stored somewhere locally for activation as you require it.
SOME BEGINNER TIPS
When you first boot to slax you may be presented with a text prompt from which you are required to login and type 'startx' to get a graphical interface. if this is the case the username/password is root/toor.
Logging in
Inside the control centre you can arrange for an auto login of your user and you need to edit the slax.cfg file (inside the slax folder) and append init~4 to the autoexec= line in order to auto boot to a GUI.
The Slax Community
The Slax community is a great help to new comers provided you follow the correct ediquette when posting in the forum. Be sure to use the search function before asking basic questions as nobody likes to answer the same old questions over and over again. Especially when the person asking the question hasn't bothered to help themselves by doing a little searching. If you find slax doesn't work nicely on your system, find the thread in the forum by Fanthom called REMIX v8 (32-bit) or REMIX v9 (64-bit) and download the community version which is more up to date and widely compatible.

I have compiled some Slax information below to help users of Slax based on the questions i see most often in the Slax forums. I have divided the information into sections of beginner, intermediate & advanced. Beginners don't want to be bombarded with linux speak and advanced users have no need to practice the basics.
I found the official documentation on Slax lacking somewhat so i hope that some Slax users find something of interest here. Feel free to contact me if you have any questions and i will answer wherever i am able. Don't forget to take a look at the downloads section to find some useful scripts that i created to make life a little easier for the slax beginner.
Installing Slax
If you are planning on trying Slax then it is recommended you load it onto a USB flash drive. Simply head over to the Slax website and begin to build your system by clicking on
Get Slax and adding the packages you will require. Most packages have dependencies that are required in order for the program to run. The website will let you know if you have chosen a package that requires something else and you can find it and add it to your build. I recommend just downloading the standard package 'Slax for USB' as it will contain most of what you need. You can always download additional modules from the website later. Be sure to download the Slax .tar file and not the ISO which is for burning to disk.
Windows Users
(requires administrator account)
Plug in your Flash drive and take note of the drive letter it is assigned. Unpack the file you downloaded using a tool such as 'winrar' or '7-zip' You will see that it contains two folders One called 'slax' and the other called 'boot'. Copy these two folders onto your flash drive. You now have to make the flash drive bootable. Open up a command prompt by holding down the 'windows key' and pressing R. Type in 'cmd' and press enter. Change directory to the USB by entering in the drive letter that you noted earlier followed by a colon (:) and press enter. (E.g f:) Now change to the 'boot' folder by typing: cd boot
There is a batch file called bootinst.bat that contains the script to make your USB bootable and we will now run it by typing: start bootinst.bat
Follow the instructions from here and be sure to confirm that the correct drive letter is being made bootable. This is important as this will write into the mother boot record on the first sector of the device.
I have created a Windows Slax USB installer for ease of use that will instal slax for you by way of a pretyy GUI. You will need to have downloaded the slax files in advance for this.
To create a robust Slax install you can divide your USB device into 2 partitions. For example i have a 2Gb flash drive.
- Partition 1: 256Mb FAT32 with BOOT folder
- Partition 2: 1.7Gb Ext2 with SLAX folder
Partition 1 contains the boot files and some extra storage space because windows will recognize this partition and not the linux partition. Partition 2 contains the slax files and your changes. The reason to use ext2 is because it is not a journaling file system which writes thrice as much data to your limited read/write USB device hence prolonging its life span. This is of course at the sacrifice of the peace of mind of a safer file system however i have not yet experienced any faults using ext2 and my important data is stored on a hard drive.
To get started first boot into a linux operating system. From here you can either run my slax2usb script or issue the following commands from a console.
(USB drive for example puposes is /dev/sdb)
Create your two partitions using the menu system
# cfdisk /dev/sdb
Format the smaller DOS partition
# mkdosfs -F 32 /dev/sdb1
Format the remaining partition
# mkfs.ext2 /dev/sdb2
Copy the 'boot' folder from your slax download to the smaller FAT32 partition.
# mkdir /mnt/sdb1/boot
# cp -R /mnt/sda3/boot/* /mnt/sdb1/boot
Copy the 'boot' folder from your slax download to the ext2 partition
# mkdir /mnt/sdb2/slax/*
# cp -R /mnt/sda3/slax /mnt/sdb2/slax
Change to the boot folder and run the boot install script
# cd /mnt/sdb1/boot
# ./bootinst.sh
Slax Boot Cheatcodes

As slax is booting you have the option to press the TAB key and intercept the boot process. After this you can enter certain cheatcodes that are passed onto slax in order to load, or prevent the loading of certain functionality. This is a handy feature especially if you want to troubleshoot why slax isn't booting correctly. It also has the added advantage of disabling the loading of certain modules, or loading the modules in your optional folder automatically.
It should be noted that instead of intercepting the boot process with the TAB key you could also open the file boot/slax.cfg and append your chosen cheatcode to the end of the autoexec= line in the menu that you choose to boot to.
Here are some of the useful cheatcodes that a beginner might use:
nohd
This option will force slax not to mount any hard drives during boot. Mounting a hard drive simply means that the hard drive is loaded and made available to you for browsing. This cheatcode is useful if you think a hard drive may be causing a problem during boot. The official slax v6.12 has no support for the linux ext4 file system so in some cases you may not want to mount the drive. If slax takes any longer than 1 minute to start then you can choose this option to see if a HD is causing the hangup
nocd
No CD/DVD drive will be loaded after slax boots. I have never seen an optical drive cause a problem in slax but this option may come in handy if you want to diable the use of an optical drive and physically removing it is not an option.
nosound
No sound drivers will be loaded during boot. Sound cards don't usually cause a problem but this code may be useful if you are scared of noises, or you are starting your machine late at night and don't want to wake people up.
from=/dev/sdb1
This code tells slax exactly which partition holds the slax files that you want to boot from. You should replace sdb1 with you partition which can be seen by typing: fdisk at a console. This is very useful if you run slax from a hard drive, and you want to boot from a USB drive instead. After slax boots from your UAB it may find the files on the hard drive and use this installation to boot into. from= allows you to specify which drive to boot from. It may shave some seconds off your boot time as slax no longer has to search for the slax partition.
changes=/slax/
This can be useful if you are unsure how to edit the slax.cfg file to configure your changes. You can specify where slax should save your changes before it boots. You may have as many changes files as you wish which can be useful for advanced users. In the example shown slax will save the changes in the 'slax' folder inside a sub folder called changes.
passwd=ask
This allows you to have slax ask you for a new password after it boots. You should have changes enabled for this to work effectively. It is always wise to change a default password to something only you will know.
toram
Slax will load itself into ram and you can remove your USB drive and continue to use slax at a frighteningly fast pace. You will need to have over 300Mb of RAM for this feature and slax will take a little longer to boot, but the resulting increase in speed can be useful if you are using a slow system.
copy2ram
Same as above
load=module.lzm
This function allows you to load optional modules from the /optional/ directory. You can use full module name (module.lzm) or you can skip the extension
noload=
This is used to disable loading of any of the modules specified. This affects all the modules including /base and /modules, so using noload=kde for example will disable loading of all modules with 'kde' in the name. It is useful with the copy2ram cheatcode, because you can disable loading of any modules you won't use so they won't chew up your RAM.
The following cheat codes can also be place in the slax.cfg file and they will have the same result. Some of them are best used in the slax.cfg and others are best used as a cheatcode before slax boots. You can hit the TAB key as slax boots and enter these cheatcodes.
from=/dev/sdb1
This can be very useful if you want to force the loading of slax from a certain partition. Imagine that you have two partitions and a USb drive and all of them contain slax. One is used for all your developing work, the other is used for graphic type work and as a media server while the USB device is used for testing. With the from= code you can choose which partition to boot from, otherwise when you want to boot from the USB device you may find slax loads from the partition from the hard drive.
changes=/slax/
Probably an easier way to manage multiple slax installations is to use the changes= cheatcode. You can have three different folders hlding three different sets of changes. One is a slax system set up for developing, the other for music , media & browsing the web and another for testing applications. Simply by using the changes= cheatcode you can specify which slax system is loaded. Of course the same default slax is always loaded, and then your changes are loaded on top of that.
acpi=off
This is a hardware troubleshooting cheat and none of the acpi (Advanced Configuration and Power Interface) functionality will be loaded at all, you'll have to use the "pcimodules" command after logging into Slax and you'll have to try to modprobe all required modules from the list manually.
nohotplug
This will primarily be used for troubleshooting as you will lose alot of functionality while using this code. If slax hangs for too long during boot you could try this cheatcode to see if it no longer pauses. As above you will need to load module manually.
nopcmcia
This will stop slax loading the pcmcia functionality which is quickly becoming a legacy function anyway. My system doesn't have a pcmcia input so i include this code in my slax.cfg so slax knows not to even try loading it. On older laptops it could be useful for troubleshooting.
noagp
This is used to trouble shoot graphics problems. The accelerated graphics port will not function but it may get you through to a slax desktop.
nodma
Direct memory access or dma can sometimes cause problems as it allows certain hardware subsystems within the computer to access system memory for reading and/or writing independently of the central processing unit. It frees up some processing power but on some systems this may cause a problem with slax. If you find your graphcis are a little choppy when you visit graphic intensive websites then you can try loading this cheatcode for troubleshooting.
noauto
This will stop the automatic mounting of all partitions in your fstab file. You can use this to disable the ability for restricted users to mount drives (you will need to remove them from certain user groups too) and access the data on them. It is also useful for troubleshooting if a drive is causing a problem for slax.
nohd
Will disable the automatic mounting of all hard drives when slax boots. Useful for trouble shooting or restricting users.
debug
When you enable debug mode slax will stop and start (and restart bash several times during the boot) for troubleshooting purposes. Hit Ctrl+D to continue the booting process.
autoexec=
This is the line that appears in your slax.cfg file and can be used to pass a command to slax before it starts to boot. If you need to use spaces put a tilde (~) in place of the space. For example, autoexec=kde;init~4 will start kde and ensure you enter into a GUI.
autoexec=
I have used this to copy a custom xorg.conf file to the file system very early. autoexec=cp~/mnt/sda4/rootcopy/xorg.conf~/etc/X11/. A much easier way to get this done is to add SKIP_XCONF=yes to the file /etc/X11/gui.conf which will cause slax to skip xconf and not rewrite your custom xorg file.
To see the autoexec= line that you used to boot you can enter the following command at a console:
cat /proc/cmdline
The boot script /etc/rc.d/rc.S makes checks for the autoexec= values. For example you will find the following line:
if ! grep -wq nohotplug /proc/cmdline ; then
if [ -x /etc/rc.d/rc.udev ]; then
/bin/sh /etc/rc.d/rc.udev start
fi
fi
This checks the autoexec= value and looks if you have passed nohotplug. If you haven't (! grep) then it will start udev if it exists (if [ -x /etc/rc.d/rc.udev ]; then). In one slax system i wanted to speed up the boot so i removed alot of these checks. Obviously udev is going to exist so i removed any checks for it and replaced it with /bin/sh /etc/rc.d/rc.udev start. If you want to stop the spewing messages as slax boots you can add splash=silent quiet to the autoexec= line which will suppress the output and give you something pretty to look at while slax boots. Can you guess what the following will do?
autoexec=echo~Shutting~power;poweroff
sgnfile=
When slax boots the linuxrc script inside initrd looks for the partition that holds the livecd.sgn file. There is not much in this file as it is only used as a marker for where slax should boot from.
# Find livecd data directory by searching for livecd.sgn file
SGN=$(cmdline_value sgnfile)
if [ "$SGN" = "" ]; then SGN=livecd.sgn; fi
echolog "looking for '$LIVECDNAME' data directory (searching for $SGN file)"
# First, try from= boot argument, if given
DATAFROM=$(cmdline_value from)
You can pass a custom lived.sgn name to $LIVECDNAME using this cheatcode. You could use this to decide which slax you want to boot from, your developing slax, your media server slax or your test system slax. You just need to rename the livecd.sgn and pass this cheatcode during boot.
noauto
I was once asked how to disable a user from mounting hard drives in slax. The solution i came up with was to use this cheatcode during boot (or nohd) or run a script at boot to unmount all drives, and put a custom udev-rules /etc/udev/rules.d/50-udev-default.rules into rootcopy. You could try to fool the user by creating an alias for mount so if they attempted to use mount it would scare them.
alias mount='echo "access to removable devices has been disabled"
A much easier way would simply be to remove the hard drive!
The boot process
Slax has a slightly different booting procedure compared to other linux flavours. It starts off just like all linux systems where the kernel unpacks initrd to memory. In all linux systems init is now started and in slax this starts from a ramdisk and is actually a symlink to the linuxrc script which Tomas M implemented. This is the guts of slax where the liblinuxlive scripts come into play and the livecd.sgn file is found. After this aufs is mounted to /union with writeable branch at /mnt/live/memory/changes so the whole tree becomes writable and all modules are mounted to /union.
After the Linux Live Scripts have finished the next stage is called 'pivot_root' which moves content of initrd to /union/mnt/live. From this point linuxrc is chrooting (changing root) directly to /union which is the 'real slax'. The final step sees Slax jumping back into the normal linux world where /sbin/init is launched and followed by the regular boot scripts rc.S, rc.M, etc
In simpler terms the module loading order goes like this ... base modules are loaded first, then modules from the 'Modules' folder, then the ones in the optional folder, then the changes structure is written over and finally the /rootcopy is injected.
Hacking the linux boot scripts
I have documented step by step the process that slax goes through when booting from the moment you press the power button to the KDE window manager. This was useful for me to understand how slax works and at the same time i was building linux from scratch. I was creating a lightweight public kiosk using slax and i wanted to strip the boot scripts down to a bare minimum in order to get slax up and running as quickly as possible and to remove the use of cheatcodes and other functions.
i found i could reduce my booting speed by 50% and ended with a slax system that booted in around 15 seconds. Most of the checks slax makes for processes are really not required such as searching for the livecd.dgn file. For my purpose i knew exactly which partition i was booting from so i could simply set that variable in the boot scripts and be done with it.
I found no reason check for udev first ... so i removed most of the code and just ran it! So alot of these checks were bypassed and i removed most of the hardware checks. I removed the starting of services i wouldn't use such as bluetooth, pcmcia, cups and samba. What i discovered was that there isn't really a whole lot needed to get slax up. Rather than posting my boot scripts i have created a log of what i removed so others can follow and choose what they will need to remove. You will need a good understanding of shell scripting to follow the log and strip your booting time down.
The first step is to copy your initrd.gz to a temp directory.
Create some working directories
# tmp=/tmp/strip
# loop=/mnt/loop
# mkdir $tmp; mkdir $loop
{xtypo_code}# cp /mnt/sda3/boot/initrd.gz $tmp
Create a loop device
# mknod /dev/loop140 b 7 140
Unpack your initrd.gz file
# tar zxvf $tmp/initrd.gz
Mount your initrd
# mount -t auto -o loop $tmp/initrd $loop
Now you can enter the /mnt/loop directory and see the contents of the initrd file. The linuxrc & liblinuxlive scripts are the scripts you can strip here. There isn't much to remove from the liblinuxlive script as you can usually just disable the call to it, or set a variable manually in the linuxrc script. The other scripts you will want to edit are the /etc/rc.d/rc.S and rc.M scripts. You can follow along my with my log file and choose which elements you want to remove as the log follows the general flow of the scripts.
Once you have finished editing the linuxrc & liblinuxlive scripts you will need to repack your initrd file and replace it with the actual initrd.gz that is used to boot with.
# gzip $tmp/initrd
I suggest making a backup of your original files so you can restore your slax if it decides not to boot after you've hacked it to bits.
Saving Changes

Now that you have slax installed you should configure it to save your changes. By default flash flushes all changes made and starts from a default install. Now setup a save file where all the changes you make to the default system will be stored. Open up your window explorer and enter into the folder called 'slax'. You should see a file called 'slaxsave.zip'. Unzip it which will produce five more zip files with varying sizes. Find one that you think you will need, and that will fit onto your USB device, and unzip it. The file it produces is the one you will use and it is called slaxsave.dat. You can remove the other zip files now except for the original slaxsave.zip.
Now you need to edit a file so that slax knows where to find your slaxsave.dat file. Go back over to the 'boot' directory and open the file called 'slax.cfg' in a text editor such as wordpad. Scroll down until you see the line below:
LABEL xconf
MENU LABEL Slax Graphics mode (KDE)
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4 changes=/slax/
You need to add something to the end of the autoexec= part. Make a space after whatever is written following autoexec= and type in 'changes=/slax/slaxsave.dat'. If the changes line already exists just alter it so it looks like the code below.
LABEL xconf
MENU LABEL Slax Graphics mode (KDE)
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4 changes=/slax/slaxsave.dat
Save the file and close it and you are ready to boot to slax. First you should ensure that your BIOS is setup to boot froma USB device. You can search the internet for how to get into your BIOS if you are uncertain.
If you are using an ext2 partition for your changes then you can safely use the changes directory instead of the slaxsave.dat file. Just create a folder in the root of your storage called 'changes' Now open (in a text editor) the file called slax.cfg located in the boot folder. In the Graphics Mode menu section add to the end of the autoexec= line: changes=changes
You could store the changes folder inside your slax folder. In this case enter changes=/slax/
LABEL xconf
MENU LABEL Slax Graphics mode (KDE)
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4 changes=changes
You should test your changes immediately following this and make sure that they are being saved. I found when i didn't create the folder first it took a couple of boots before slax decided to create the directory on its own.
All of the changes you make to your slax system are immediately recorded in the directory /mnt/live/memory/changes. To test this you can create a test file on your desktop and check for it in the live changes folder /mnt/live/memory/changes/root/Desktop. My preferred method of using Slax is to boot to 'always fresh mode' and if i need to save changes i create a module from my changes. This is certainly the way i would recommend setting up slax initially. I have a script in my /usr/bin folder called bupchanges (with no extension). The script looks like this:
#!/bin/bash
dnow=`date +%y%m%d`
dir2lzm /mtn/live/memory/changes /mnt/sda3/slax/modules/changes-$dnow.lzm
echo
echo "All done. Module is in your modules folder"
exit
This creates a module with todays date appended to the end of the file when i type: bupchanges. When i accumulate a few of these i will unpack them all into the same directory, and delete the /tmp /var /mnt folders and all whiteout files. To make this job easier i created a module called the 'Slax Modtools' which can manipulate slax modules. It has following functionality:
- Activate module
- Activate a folder full of modules
- Deactivate modules
- Unpack module
- Create module from folder
- Mount module on loop for browsing
- Merge modules together
- Convert a slax package into a slax module
- Convert a folder full of slackware packages to module
- Extract packages from a module and create new module
- Remove packages from a module and create new module
- Convert a module from sq3 to sq4
- Convert a folder full of modules from sq3 to sq4
The command dir2lzm and lzm2dir both call a script located in your slax/tools directory. I recommend opening the file in a text editor and studyting it.
The Slax Modules
Instead of the traditional style of downloading a program and installing it, slax uses a file called a module which you activate (install) or deactivate (uninstall). The files are similar to zip files in that they are compressed. The file extension of Slax modules is .lzm. To activate a module you simply double click on it and it will be injected into the Slax directory structure and all the required files will be put in their place. To deactivate the module just double click on it again and all the files will be removed from the directory structure and packed back into the module. This makes installing applications very simple and you don't clutter up your computer with thousands of rarely used files.
You can activate modules directly off the slax website or download them and store them on your computer or flash drive. Please be aware that not all modules contain everything they need to run on your computer. Sometimes a package has linux dependencies which are required on your system in order for it to work properly. The bottom left of the slax website will tell you what other modules you will need (and do not have activated) in order to satisfy the packages dependencies.
Modules that are placed into the slax/modules folder will be activated automatically when slax boots. Modules that you only want to use occasionally can be stored in the 'optional' folder. Both of these folders are located in the root of your slax storage device in the folder called 'slax'
I store all of my modules on a hard drive and have a script that makes activating modules very easy. You just open the program and type the start of the name of a module into the input box and it will search for and activate it. Look in the Slax Modules menu at the top right of this page,
Slax modules are compressed using the LZMA (Lempel-Ziv-Markov chain Algorithm) compression algorithms and a squashfs file system. The result is a file that when double clicked on will inject itself into the Slax direcotry structure. LZMA compression is known for it's fast decompression rate however this is at the expense of a slower compression rate as extra passes are made.
The modules in the base folder contain multiple packages in one module so if you are looking to remove or extract a package from a module you will need to decompress the file. Slax has built in commands to decompress or create modules. For example if i wanted to decompress a module on my desktop called firefox i would issue these commands at console:
# mkdir ~/Desktop/myFolder
# lzm2dir ~/Desktop/firefox.lzm ~/Desktop/myFolder
Like wise, one can create their own modules. Imagne that i have a script that searches my 'optional modules' folder for a module that i type the name of. I want this script to be in my /usr/bin directory so i create a fake /usr/bin in my /tmp directory and put the script in there.
# mkdir -p /tmp/fakeFolder/usr/bin
# cp ~/Desktop/myScript.sh /tmp/fakeFolder/usr/bin
Now i can create a module from the fakeFolder and when this module is activated it will inject the script into the /usr/bin directory.
# dir2lzm /tmp/fakeFolder ~/Desktop/scriptModule.lzm
I've created a module which you can download from the Slax Modules Section here that can manipulate Slax modules in many ways. It can create, deflate, merge and mount modules aswell as extract or remove packages from modules. By the way here is the script that will search your 'optional' folder for your chosen module. To use it copy the following text into a text editor (replace sda3 with your partition) and save it somewhere as script.sh, then make it executable by issuing: chmod +x /path/to/your/script.sh
#!/bin/bash
INPUT=$1
for a in `find /mnt/sda3/slax/optional -name *$1*`; do
echo $a
done
This is some test text to see if the article content will wrap around my insert menu module.
This is some test text to see if the article content will wrap around my insert menu module.
This is some test text to see if the article content will wrap around my insert menu module.