2009-05-16

Slax...or every jedi must make his own lightsaber

Slax is a portable version of Linux that can be run from a cd-rom, a flash drive, or even launched from a hard drive. What makes Slax so special is how easy it is to modify. Slax is made up of modules and magic.

The by default Slax runs a simple KDE desktop. It can be extended by adding modules to it. Modules can be downloaded from the internet while it is running and installed and used immediately. There is also a "modules" folder for adding modules that will run when slax is started. There is a limited amount of memory and a limit to how many modules can be loaded. There is also a folder called "optional" where you can place modules that you want to load only when they are going to be used. For example you could load one set of modules for reformatting a hard drive (gparted). At another time, load a set of modules for working with encrypted file systems (truecrypt). At another time, load a set of modules for recovering pictures from a memory stick (testdisk).

Then for the magic. There is a folder called "rootcopy" when slax boots the followng happends
  1. The kernel loads
  2. The base modules for linux, x, kde, etc are loaded.
  3. Services are started
  4. Modules from the "modules" folder are loaded
  5. Everything in root copy is copyed to the root of the linux system.
  6. rc.local is run
  7. a text prompt or kde session starts.
So it is possible to drop in scripts and files into users folders. Scripts can be run before users are logged in, or a kde session can be started and KDE can autorun any programs or scripts desired.

A typical Linux guru can install slax on a memory stick, set the stick to be bootable, copy modules into the modules folder. Copy files into the rootcopy folder. Then have a customized copy of linux that does exaclty what they want it to do. That is the beauty of Slax. Any other live Linux distro can be remastered. However it takes much more work and skill to do so. Slax makes it easy and fun.

My copy of Slax has the following tools on it.
  • ssh to allow remote logins
  • x11vnc to allow remote control of the KDE desktop
  • dmraid to deal with systems with RAID arrays
  • gparted to rezie drive partitions
  • partimage to backup and restore partitions
  • samba to connect to smb shares for back/restore jobs
  • testdisk to recover deleted files on flash drives
  • truecrypt for working with encrypted drives
Over the course of the next several blog entries I am going to show how to do the following.
  1. Download Slax with most of the needed plugins
  2. Add the remaining plugins and to be able to dual boot Slax and Windows
  3. How to resize paritions, mount windows folders from the network
  4. How to backup and restore windows over the network
  5. How to create a "recovery CD"
  1. When this series is done you will be able to remotely reboot a windows machine to run Slax and then create a backup image or restore a backimage. This makes it possible in a company to fix a broken windows install. From 1000 miles away you can reboot a broken windows install and replace it with a backup copy to get everything working again.

4 comments:

Francisco said...

Sounds easy to easy could it be the path to the dark side :-)

Believer said...

Great Job!! Keep up the good work!!!---Believer

Jos Poortvliet said...

You ever tried to play with susestudio.com? I've build SLAX images and frankly it was a pain. Got a bit easier over time but you always have to have it on your own system somehow, spend a long time with scripts and such - SUSE Studio is just a point and click webinterface (but the underlying tools are fully open source and you can actually export a xml for them).

Pretty awesome :D

And tomorrow openSUSE 11.4 will be available, bringing you the latest & greatest of FOSS ;-)

Elder Geek said...

@jospoortvliet

I have not played with susestudio.com though I have heard good things about it. Here are the reasons I use Slax 6 over other remaster tools both local and online

1. The base Slax06 image is 210mb size. This is with a complete KDE 3.5 environment and firefox. Plus there are still modules that can be dropped to lighten this image even more.

2. I can add packages that are not in slackware or in the case of susestudio, not available in their repo. All I have to do is compile myself and use dir2mod to create a Slax module.

3. I can use partiamge to create a backup of an XP or Linux install. I can then add these files to my slax image and create a bootable recovery dvd. To do this with a cloud tool, I would have to upload almost 4 gig of backup files. Also the small size of slax means I have 4.1 gig of space on a DVD for a backup.

4. The Slax setup can be placed on an XP partition, then grub4dos can be used so that you can boot to XP or boot to Slax to RAM. This allows me mount a folder over the network and to create or restore backups of the hard drive.

5. By placing files in the rootcopy folder I can customize what icons are on the desktop, add custom scripts, add wallpapers and make about any other change to the system I want.

6. I can run scripts at startup. Again using rootcopy I can create my own rc.local to run scripts before X starts. Or I can place files in /root/.kde/Autostart to run applications or scripts after KDE starts.

7. Slax provides a very rapid test cycle. If there is someting wrong with my custom CD, I can open it in an iso editor, change a file or script, save it back out and run it virutalbox with a turnaround time of less than 10 minutes. Most other local remasters take 10 to 30 minutes to recompress all the files and to remaster the iso image. Cloud solutions have a 10 to 90 minute download time after every change.

Also for me, I started out back in the day customzing Knoppix. Opening up a slax.iso in an iso editor and adding a few moduels and the rootcopy folder, then saving it as a new image has been pretty bulletproof.

Slax also has an online builder that allows the creation of a custom version of Slax without remastering.