NOTA: tale howto serve per installare linux su una chiavetta usb. innanzitutto procuriamoci una penna usb. E' consigliabile usare una penna usb da 256 anche se per le versioni indicate, per alcune bastano una penna anche di capienza minore. Prendiamo la penna usb e andiamo a visitare il sito http://slax.linux-live.org/ scarichiamoci la versione killbill. accediamo con i permessi di root creiamo la directory /slaxUSB # cd / # mkdir slaxUSB montiamo la iso # mount -o loop slax-killbill-5.0.5.iso /slaxUSB/ Prima dobbiamo creare la directory sda sotto /mnt # mkdir /mnt/sda A questo punto dobbiamo montare la nostra chiavetta usb. # mount -t vfat /dev/sdax /mnt/sda (dove sdax e il valore riconosciuto dal nostro linux per la chiavetta (normalmente sda1)) se aveste dei dubbi al mount lanciate un # tail /var/log/messages e controllate. bullet horizontal rule fatto cio' lanciate questo comando # cp -ra /slaxUSB/* /mnt/sda/ dovete copiare vmlinux e initrd.gz nella directory boot della chiavetta # cd /mnt/sda/boot/ # cp vmlinuz /mnt/sda/ # cp initrd.gz /mnt/sda/ rientrate nella directory /mnt/sda l # cd /mnt/sda lanciate il comando # mv isolinux.cfg syslinux.cfg # vi syslinux.cfg lanciate il comando editate il syslinux.cfg cancellando /boot/ dalle righe /boot/vmlinuz e da /boot/initrd.gz (devono diventare vmlinuz e initrd.gz) per renderli visibili al boot e salvate il file syslinux.cfg modificato . scaricatevi il tool syslinux http://www.kernel.org/pub/linux/utils/boot/syslinux/ e installatelo sulla vostra macchina linux (per chi avesse dei problemi di compilazione esiste tale versione gia' pacchettizzata. Ovviamente gli utenti debian sono molto piu' avvantaggiati :D con il pacchetto syslinux.deb) a questo punto lanciate il comando # syslinux -s /dev/sdax (dove di norma sdax e' sda1) ora no vi resta che far bootare la chiavetta usb e avete il vostro linux su una chiavetta usb. L'autore consiglia anche per chiavette minori di 60 mega queste distro: Damn Small Linux, Puppy Linux, Feather Linux ************************************************************************* rc.local file di configurazione di partenza ************************************************************************* Come aggiungere i miei file modificati alla slax: Il metodo migliore è creare un modulo slax (.mo). C'è un altro metodo altrettanto valido se ho bisogno di cambiare solo pochi file, esso è chiamato rootcopy. Il CD SLAX CD contiene una directory /rootcopy/. Il contenuto di questa direttory è copiato nella root ogni volta che parte la SLAX, preservando tutte le directory. Dunque, per esempio, se io voglio usare il mio xorg.conf file, creare /rootcopy/etc/X11/ directory sul CD e salvare il proprio xorg.conf dentro. Potremmo anche usare un altro metodo per modificare i dati in SLAX. Far partire SLAX ed effettuare le modifiche, (Cambiare lo sfondo, cambiare la tastiera, etc). Salvare i cambiamenti in /tmp/my_changes.mo, per esempio, utilizzando: configsave /tmp/my_changes.mo Finalmente masterizzare questi file nel CD di SLAX dopo averli copiati /modules/ directory. How to modify SLAX ISO (come modificare l'ISO) Copiare l'intero CD sull'HD. Modificare quello che ci serve, aggiungere e/o cancellare. Quando Ok eseguire i seguenti comandi per rifare l'ISO CD: cd /your/slax/directory ./make_iso.sh /tmp/new-slax.iso Se stai lavorando sotto windows, eseguire invece i seguenti comandi: cd c:\your\slax\directory make_iso.bat c:\new-slax.iso Un nuovo CD avviabile è pronto con le modifiche effettuate. ************************************************************************* How does the LiveCD work? It can be divided into three parts. At first, Linux kernel (vmlinuz) is loaded, initrd.gz is unpacked into 4.4 MB ramdisk in the memory and it's mounted as a root filesystem. Second phase is done by starting /linuxrc script. It's a part of Linux Live scripts, which is copied into initrd.gz during the LiveCD creation. Temporary filesystem (tmpfs) is mounted by linuxrc to /mnt and all files from /base and /modules directories on the CD are inserted into live filesystem (eg. base/kde.mo is mounted to /mnt/kde.mo, base/xwindow.mo is mounted to /mnt/xwindow.mo, etc.) Next, images specified by load= kernel boot parameter are inserted (from /optional directory on the CD) and finaly /mnt is chrooted. (/mnt will become /, so for example /mnt/bin/bash will became /bin/bash) In the third phase, /linuxrc starts /sbin/init. It's /mnt/sbin/init in fact, but now /mnt is chrooted so /sbin/init is called (by using exec bash built-in command). That's all. From this point, it's up to your Linux to do all other jobs, eg. recognize mouse or configure X properly. ^ top How to configure network SLAX uses DHCP to autoconfigure your network card's IP address, route tables and nameservers. If you are on the network with DHCP server then you shouldn't have any problem. Just boot SLAX and everything will work. The only exception is proxy. If your ISP offers a proxy for web browsing, you will need to configure it manually, because it's not a part of DHCP response. Just start KDE and click the icon for Control center. Choose Internet & Networking menu and then Proxy. Click "manual proxy configuration" or something similar. It could happen that you don't have any DHCP server. In this case, you have to configure your network manually, by using the following commands: ifconfig eth0 123.123.123.123 netmask 255.255.255.0 route add default gateway 123.123.123.1 echo "nameserver 123.123.123.10" >> /etc/resolv.conf Of course, you have to know your correct IP address, netmask, default gateway and nameserver, else you won't be able to make any connection to the Internet. It's also possible to setup a Modem connection, just run kppp in KDE, it will start a wizard. The only one thing you should know is that your modem device is /dev/ttyS0 or /dev/tts/0 (both for COM1), or /dev/ttyS1 or /dev/tts/1 (for COM2), etc. If you are using ADSL then you could try adsl-setup and adsl-start program. If you are using wireless connection, try iwconfig. If nothing works for you, then you will need some special configuration (which I don't know, of course), or your hardware is not supported in Linux Kernel (there is not any module [driver] for Linux). In this case, just wait few weeks/months/years, or write your own driver for it :) How to save files on the floppy It's easy with SLAX. Just boot SLAX with "slax floppy" boot command. It will automatically mount it in /mnt/floppy directory (everything you write to this directory will be written to the floppy) If you wish to mount it manually, do the following: mkdir -p /mnt/floppy # for the case the directory doesn't exist yet mount /dev/floppy/0 /mnt/floppy Before ejecting the floppy, be sure to either unmount it by the command umount /mnt/floppy or simply reboot the computer. You _must_ do one of this to unmount the floppy properly and save all cached data to it. If you wish to replace your floppy by another one then just unmount the first one (umount /mnt/floppy), then eject the disc and insert another one, then do mount /dev/floppy/0 /mnt/floppy All the commands I wrote have to be executed at the command line, or in terminal emulator (konsole, xterm, etc), or by using K-menu/Run command. ^ top How to save/restore settings To save your settings, run "configsave" command with one argument - the storage location. So type for example configsave /mnt/sda1/slaxconf.mo to save your configs in USB flash drive into slaxconf.mo file. It will save all changed files from /root, /etc, /home and /var directories. Note that that network settings (assigned IP address, etc) won't be saved because they are not kept in any file. If you wish to save network settings then add apropriate commands to /etc/rc.d/rc.local. This file will be saved/restored, and it's executed automatically (so your network settings will be set up). To restore your previously saved backup, use "configrestore" command. You can also save settings to the root directory of your existing disk partition (for example to /mnt/hda1/slaxconf.mo). All settings found in the root folder of any of your disk partitions ( under the name slaxconf.mo) will be restored automatically when SLAX boots. ************************************************************************* How to check the integrity of downloaded ISO Each file for download has it's own md5sum. This checksum is used for several purposes, the most common is to assure your download wasn't corrupted. When md5sum of your downloaded file is different than the one published at these pages, then you can be 100% sure your file is wrong. So, every time you download a file from here, use md5sum software to create (generate) the checksum of your file and compare it with the one published at the download page. ^ top What is the (bs)diff file (at download page) for When new version of SLAX is released, you would need to download whole new iso image. Even if it's under 200 MB, it could be hard task for some people with slow connection. There are special diff files available, which contain only the differences between older and current SLAX iso image, thus they are smaller than original ISO. For *.diff files, use the following command: patch --binary -i [FILE.DIFF] -o [NEW.ISO] [OLD.ISO] For *.bsdiff files, use bspatch for windows or linux, both require gzip2 bspatch [OLD.ISO] [NEW.ISO] [FILE.BSDIFF] ^ top How to setup LILO to boot Windows and SLAX from harddisk Let's assume that you have first partition (/mnt/hda1) with some Windows OS (it's C:\ under windows) and you've copied all the files from SLAX CD to your second partition (/dev/hda2), which is using FAT32 filesystem, to a directory called SLAX (it's D:\SLAX\ under windows and /mnt/hda2/SLAX under Linux) If you wish to create a multiboot by using LILO, then just boot SLAX and edit your /etc/lilo.conf to look similar like this: (you will need to modify it a little bit to fit your needs, replace hda1 and hda2 by your own partition names) # the content of /etc/lilo.conf: boot = /dev/hda prompt timeout = 300 # WindowsXP menu entry: other = /dev/hda1 label = WindowsXP # SLAX menu entry: image = /mnt/hda2/SLAX/boot/vmlinuz initrd=/mnt/hda2/SLAX/boot/initrd.gz label = SLAX root = /dev/ram0 append="max_loop=255 init=linuxrc load_ramdisk=1 ramdisk_size=4444" read-write and then run the command from commandline: lilo -m /mnt/hda2/SLAX/slax.map -S /dev/null Lilo will setup MBR (master boot record) of your harddisk hda, allowing you to boot Windows and SLAX. ************************************************************************* How to create SLAX module There are many ways how to create SLAX modules. All commands described here work directly in SLAX, but can also work in your own distribution. For that case, download linux live scripts and run install. The following command will convert Slackware's TGZ package to SLAX module: tgz2mo application.tgz application.mo If you wish to modify your Slackware package before the module is created, use installpkg -root /tmp/package application.tgz It will install your TGZ package in different root (/tmp/package here). Modify files you need and finally convert the directory tree to module by using dir2mo /tmp/package module.mo All modules are created by mksquashfs command, which is included in linux live scripts. You can also download squashfs tools and compile it yourself. Your running kernel doesn't need to have squashfs support to use dir2mo or tgz2mo, only mksquashfs binary is needed. ^ top How to modify existing SLAX module You need kernel support for squashfs filesystem in order to modify existing SLAX module. SLAX contains this support. You can read more about squashfs here. The following command will extract content of SLAX module to directory in /tmp mo2dir module.mo /tmp/directory You can modify everything in /tmp/directory now, and when done, pack the module back to .mo format by using dir2mo /tmp/directory module.mo If you just wish to see the content of a module (without extracting it to disk), mount it by using following command: mount -t squashfs -o loop /path/module.mo /mnt/mountpoint ^ top How to use SLAX modules There are several ways how to use SLAX modules. The first one is permanent. Store your .mo module in /modules/ directory of SLAX CD (or USB). This way the module will be automatically used during boot procedure. If you wish to use your module only sometimes, store it in /optional/ directory on SLAX CD (or USB). Module will be used automatically only in the case when you specify it's name as a load= boot parameter. For example boot: slax load=wine,xmms This means: use modules /optional/wine.mo and /optional/xmms.mo this time, if you find it. Requests for non-existing modules are silently ignored. Another way how to use SLAX module is by executing uselivemod command. Syntax is following: uselivemod /path/module.mo The module will be inserted into live filesystem immediately, so the application will look like it would be installed. You will need to run the application by apropriate command. Unfortunately using modules on the fly by uselivemod can sometimes hang your machine, it's some bug which needs to be fixed. If you are using SLAX Standard Edition (or any other edition with KDE, you can doubleclick the module.mo file in konqueror, this will do the trick too. ************************************************************************* How to enable virtual memory (swap)? If you already have a swap partition prepared on your disk, SLAX will detect and use it automatically. If you don't have one, or if you wish to enable more virtual memory, use fileswap command. It requires two arguments, path to file which will be created (save it to /mnt/disk/, make sure that the target partition is writable by linux) and used for swap and desired size of swap file. The swap file won't be deleted after reboot, so you will need to either overwrite it by fileswap next time, or to remove it yourself next time you boot. Warning: don't overwrite existing swap files if they are used. There is no check for existence of it, so it could overwrite existing swap! (This has fatal results). Warning: don't create neither swap partitions nor swap files on any USB Flash Drive. Flash keys have limited lifetime and swaping to it can kill the device easily. ^ top How to use serial (COM) mouse in SLAX? Serial mouse can't be autodetected and currently I don't know how to configure it automatically. If you have a serial mouse connected to your computer, you will need to use the following command to enable it. ln -sf /dev/tts/0 /dev/mouse Use /dev/tts/0 for COM1, /dev/tts/1 for COM2, etc. ^ top How to avoid hardware problems/hangups Sometimes it could happen that your computer just hangs during the startup or very soon after it. The most important is to read the last message on the screen and try to guess what kind of hardware-probing is causing problems. Then you can use 'nopcmcia', 'noapm', 'nousb', 'nohotplug' or 'acpi=off' boot parameters to avoid probing for specified hardware. The 'nohotplug' parameter is the most powerful one, almost all hardware probing will be disabled. You will need to load all modules [drivers] manually by using modprobe command. ^ top What if Xwindow doesn't work as expected? SLAX starts in textmode as default, but all SLAX editions (except Frodo) does contain graphical Xwindow system. You can start it by using the following command after logging as root or guest: startx Xwindow with KDE or XFce will be started by using VESA driver for your graphics card, the higher available screen resolution will be 1024x768 at the maximum refresh rate of 75Hz. This is very safe option and should work on almost all computers. Nevertheless you may try to probe your hardware and find better (accelerated) driver by using xconf # to reconfigure graphics driver automatically startx # to start xwindow after xconf It can sometimes happen that xconf command configures SLAX to use higher screen resolution or refresh rate than the maximum one usable for your monitor. This usually causes a black screen after startx. At this moment try to hit Ctrl+Alt+Plus several times (Plus is at numeric keyboard). It will change screen resolution to some smaller value. If you wish to use a serial mouse (connected eg. to COM1), see above. ^ top Is your particular hardware supported in SLAX? In general, device drivers in Linux are represented by special modules for the Linux Kernel (files with .ko extension, usually found in /lib/modules/kernel/). SLAX contains almost all possible drivers which are included in latest Linux Kernel; apropriate ones are loaded automatically by using hotplug during SLAX startup. I don't know the kernel, so I'm not able to tell you if there are correct drivers for your devices. If your particular hardware doesn't work, it can be caused by two reasons: SLAX doesn't contain the kernel module (as there is no support in official Linux kernel), or hotplug wasn't able to load it. You may try the following commands in order to check if your hardware has been detected: lspci # shows all devices in your computer pcimodules # shows names of all drivers for all devices recognized by SLAX lsmod # shows all drivers already loaded in the system ^ top How to fix broken Master Boot Record If you accidentally used SLAX Installer in the wrong way and your computer doesn't boot your former operating system, you may try lilo -M /dev/hda ext -S /dev/null This will overwrite master boot record of hda harddisk (primary master) and will setup your computer to start operating system from the partition with "boot" flag. You can use "mbr" argument instead of "ext" if you're sure that the operatin system is on one of the first 4 partitions. If you don't know how to use Linux commands at all, or if you just need to fix MBR for Windows operating system, boot Windows install CD and run Recovery console instead of the installation. It's usually started by pressing R in Windows XP install. When you have the console, type "fixmbr" and confirm by Enter. See also How to setup LILO to boot Windows and SLAX from harddisk ************************************************************************* Burn the disc Once you've downloaded Slax, you have to burn it to a CD. In fact, the ISO file you downloaded from this site is a complete image of the CD. It won't work if you burnt the iso just like a regular file, so start your favourite CD-writing software and find "Burn image" or "Burn CD iso image" option. It could be hidden somewhere because people usually don't need to use this option. Sometimes you will need to change the file-type filter to *.* else you won't be able to see your .iso. Check the programs help files if you can't find the option. The resulting CD will be bootable, you don't need to specify that feature separately. Note: Some archiving software (for example winrar) could associate the .iso extension for itself. It seems like slax.iso would be an compressed archive. But don't believe this. Don't unpack the archive! burn the ISO as described above else you will lose the bootability. ^ top Steps to boot from SLAX CD All new computers support booting from the CD, but almost all of them are looking for the operating system on the harddisk only. Your goal is to force your computer to use the CDROM instead. There are three ways how to do it. The first one is supported on many motherboards. Your computer can allow you to boot from the CD once (only for this time) by pressing a special key (usually F11, F2 or F10) during the memory checks (very soon after the computer's power on). The second method is to setup your box to permanently look for a boot-CD at first, and try to boot from the harddisk only if no CD is found. Again, you have to press some key during the startup (usually Del key), which will allow you to enter BIOS SETUP. There you can go through some menus and look for "Advanced settings", "Boot order" or "Boot options". Set CDROM as a first device and harddisk as a second one. All the keystrokes mentioned above are usually written at the computer's display at the time you can press them, or you may find them in the documentation of your motherboard. Third way how to boot from the CD is by starting DOS and using linux.bat program from SLAX CD. ^ top Minimum hardware requirements SLAX is not pretentious, nevertheless it requires some minimal hardware to run properly. It depends on what do you wish to use SLAX for, of course. The most important thing is memory. You need at least 32 MB of RAM to boot slax. Read minimum hardware requirements for SLAX. ^ top Boot parameters (also known as cheatcodes) Boot parameters (also known as cheatcodes) are used to affect the boot process of SLAX. Some of them are common for all Linuxes, others are specific for SLAX only. You can use them to disable desired kind of hardware detection, to start SLAX from harddisk, to skip the login prompt and start GUI, etc. Reboot your computer and wait several seconds until nice graphical slax logo appears. (it's there usually for less then 5 seconds only). You will see "boot: " prompt at that time, under the graphical logo (at the bottom of the screen). Start typing one of the following options immediately to be faster than the timeout, or press F1 for brief help. ^ top Starting GUI After you wait for awhile, you will see different things on the screen, and finally it will get to a screen that says login. Type root as the username and toor as the password. This will get you logged in. At this time you are running full featured operating system directly from the CD! it's nice, isn't it? And it can be even nicer! You can start Linux commands from the command line you see on the screen, or you can start graphical user environment (called KDE). To start the graphical environment included with SLAX, type "startx". It will run an X session with KDE, in 1024x768 resolution, using VESA driver. You may also try "xconf" command, to attempt to autoconfigure your graphics card, monitor, keyboard and mice, and if successful, start X in accelerated mode, allowing you to use higher resolutions and refresh rates. I'm pretty sure that you will know how to get around at this point. :-) Congratulations, you're running beautiful SLAX Linux! If you don't like the autoconfigured screen resolution, refresh rate, or the K Desktop Environment, click the small blue icon in KDE system tray. If you used xconf, you'll be able to choose one of dozen resolutions and refresh rates. Fluxbox is one of the other window managers included and may be called with "flux" command. If you see only black screen after running startx, Press Ctrl+Alt+Plus (plus key on numeric keyboard) to switch to the worse screen resolution. SLAX tries to run the higher resolution available for your graphics card, but it could happen that the monitor can't handle it. The keystroke will switch to 320x200 or something similar. Scroll the screen by your mouse, go to the right bottom area and find a blue icon for resizing screen. Click it and choose some better resolution from the list.