Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

2011-08-04

The Beauty of Slax

It has been more than a year since I have written anything. I want to pick up where I pretty much left off at, working with Slax.

What is Slax? It is a modular live CD/USB Linux distro based on Slackware. The beauty of Slax is in how it is built. First you have to understand how a regular Linux live cd is built. Lets take a look at the process.

Remastering a Live CD.
  1. Space is set aside on the hard drive and a copy of the Linux that will be on the live CD is put into a folder on the hard drive.
  2. Using a special process called chroot, the computer is tricked into thinking the series of folder holding the Linux that ends up on the CD is actually a running system and commands are able to be executed on this system.
  3. Commands are then executed that download and install software. Software can be removed as well. Settings can be configured and other changed can be made.
  4. When all the changes are done a program that works very much like zip takes what is usually about 2 gigs of software and compresses it down to one file that is about 680 megs in size.
  5. The 680 meg compressed file, a copy of the Linux kernel the booted system will use and a special boot loader for starting from CD and booting Linux up are all placed together in one directory.
  6. A bootable ISO CD image file is created from those files.
  7. A CD is burned from the ISO image.
The thing to note in the above process is that after you test the CD and find anything needs to be changed you have to go back to step 2. It can be a very time consuming process.

The Beauty of Slax
With Slax the system has been broken up into a series of modules. each of these modules is mini compressed file much like the 680 meg file mentioned in the last paragraph. But instead of being 680 megs in size they are more often 10 meg or 20 meg in size. A typical slax system is made up of five or six modules like in the following example:
From left to right: Slax-Core, Xorg-Video, KDE-Desktop, KDE-Apps, KDEOffice, SlaxDev and FireFox.

The above files on a Live CD weigh in at about 210megs, so there is plenty of room for customizing and adding software to the install. At the Slax webesite there are hundreds of modules that can be added to Slax. Most Slackware software packages can be converted to Slax modules. Any package for Slackware 11 or 12 that can be found on LinuxPackages can be used.

The process for customizing a Slax CD is much simpler.
  1. The Slax CD ISO image file is opened up with an ISO editor that allows files to be added or removed from a ISO image. PowerISO or ISO Magic for Windows or ISO Master for Linux.
  2. Any slax module can be added to the /modules folder or removed from the /modules folder
  3. Any files that are not in modules can be put into the /rootcopy folder. Example: to put the file README.TXT on the desktop put it in /rootcopy/root/Desktop.
  4. Files that are to be available on the CD but not copied the the running system can be put in /extra
  5. Save the ISO image.
  6. Burn the ISO image to disk.
In less that 5 minutes you can find a Slax module on the Slax website, download it, open up the Slax CD in an ISO editor, place the module in the /modules folder, save the ISO Image and burn the CD. That is a far cry from the minute or two to get into a chroot environment, two more to download a program and then another 10 or 15 minutes to compress the 680 meg file and another 2 minutes to create a CD image.

Thus what is a 30 minute plus job for any other Live CD is a 5 minute job in Slax.

Slax is a serious tool for computer professionals. It is also serious fun to customize and work with.



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.

2008-12-19

Now for something completely different

To pick up from where I left off last time.
There at last I was experiencing my first joy in Linux. I had choices. Instead of just the one look that Microsoft provides for Windows. Or the one choice that Apple provides for OS X. Linux lets you choose if things looks like Microsoft Windows, Mac OS or something entirely different.

In Linux when you decide you don't want to run just a plain text terminal and you want to run with graphics. That brings you into the world of X. For Microsoft they call it Windows. In linux it is called "X". The X server provides a very basic graphic display and handles the mouse and keyboard stuff.

The X graphics are very primitive. The buttons and window borders are clunky. Things look like a beta for Windows 3.1. The nice thing about pure X apps is they run on about any Linux setup you can imagine. To get more advanced looking dialogs, buttons, menus and such, a graphic toolkit is used that provides a cleaner look. The downside is the library has to be installed on the computer for it to work.

If you used every graphic tool kit ever made, it would be hard to keep up. In reality, only a few have ever mattered. There is gtk, the Gimp Tool Kit. Originally written for a program called GIMP. gtk was an easy tool kit to use to give Linux programs a good look. After GTK, there is GTK2, the newer gimp tool kit.

Most people expect a modern computer to provide a WIMPy environment. Winodws, Icons, Menus and Pointers (mouse). Microsoft provides that look for Windows. In Linux you can choose what programs provide that look. They come in two flavors, Window Managers and Desktop Enviroments.

The Window Manager (WM) is very simple. It provides the basics. Things like menus, a way to start programs, the boarder around programs, the title bar of programs. The way to switch between running programs. What the mouse does, what the keyboard does, shortcut keys, right clicks, left clicks, double clicks. All of this is provided by the Window Manager.

The Desktop Envirionment (DE) is Window Manager plus more. They do all that window mangers do. But they can also provide their own graphic tool kit. They can also provide servies for dealing with sound, video playback, networking and more.

With a Window Manager, they don't provide all the tools. For instance a window manager may not provide a taskbar that shows what programs are running. But since any plain X program or GTK program can run on any WM, there are dozens of task bars that you could use if a WM does not have one. Choice is the key word here. Do you want a transparent task bar? Do you want one that runs down the side of the screen or across the bottom? Do you want it to be able to hide? Do you want it to hide automatically or only when you click on it or press a certain key? No matter what it is you want, someone has probably written a taks bar that will do it that way.

So any standard Linux app will run with any Window manager. You have lots of choices in Window Managers. You have lots of choices in apps.

The Desktop Environments do it all. It may not be possible to replace the task bar. Because even if you can hide it. Other programs may not be able to take over the job. The DE wants to do it all. Also, because of the searvies that DE's provide. Like printing and sound. As well as the look and feel. Programs are written that only run on a particular DE. KDE programs need KDE to run, GNOME programs need GNOME to run. You can mix and match. I.E. You can run KDE and have GNOME on the computer but not use it as your DE. Then you can run both KDE and GNOME programs. But the same is true for the WM's. You can run KDE and GNOME apps with many WM's. You might loose a feature or two, but you can do it.

You can go to Window Managers for X to see what is out there. To cut to the chase. Most people run GNOME or KDE and there are holy wars about which one is better. So GNOME has 40% of the pie and KDE has 40% of the pie. The remaining 20% is made up of every thing else. XFCE, Enlightenment, Fluxbox, fvwm, AfterStep, IceWM, and many others.

My first day in Linux introduced me to both Gnome and KDE. After playing around with them for a few days. I settled on KDE, I just liked it better. Gnome had a cleaner look to it. But everything took up a bit more space. Eating up screen real estate I needed. In windows I always customized my envirnment to make working with it more natural for me. I found it easy to customize KDE to make it work like I worked in Windows.

Since that time. I have tried every major DE and WM out there. Where am I at now? I prefer KDE apps over most GNOME apps. When I want a small and fast app, I want something that is GTK2 or GTK. I like light and fast. so my choice of what I run for WM/DE is in this order: Fluxbox, XFCE4, KDE 3, Gnome, Enlightenment, and then KDE4.

I will justify my decision to run Fluxbox in my next post.