Creating a Bootable USB with slax-cyut Live CD
也請見 中文版.
Why Slax?
Slax is small: < 200MB and
yet very usable. It even includes KDE desktop. It is modular: If
you need more packages, go to the well-maintained slackware distribution and pick
your favorite tgz packages, convert them to lzm format (e.g.
execute tgz2lzm vim-7.1.tgz vim-7.1.lzm
under slax),
and copy the lzm file into the slax/modules/ directory. Next time
you boot slax, your favorite packages will be available.
It has quite a few interesting features that makes customization painless. It just rocks.
Important note: After living on a slax usb key for a
few weeks, I realized that both /var/run/xdmctl and /var/run/dbus
seem to contain files that are most often updated and that cause
most wear and tear on the usb key. So I added these lines to /etc/fstab:
tmpfs /var/run/xdmctl tmpfs defaults 0 0
tmpfs /var/run/dbus tmpfs defaults 0 0
I have been using a slax usb key without crashes related to wear
and tear for a few months since this change.
Creating a Bootable USB with slax-cyut
The CYUT version of slax is available at this ftp site. This live cd includes mk-boot-usb plus some more modules, which you can also download individually here. The following is a sketch of how to create your own slax bootable usb key using this live CD. Chinese version is also available.
- Boot the slax-cyut live cd.
- Run mk-boot-usb to create a bootable usb key.
- Let's suppose that the content of the slax cdrom will be copied to the slax-6.0.7/ subdirectory of partition 5 of the usb key.
- Figure out the location of the cdrom using
grep iso9660 /proc/mounts
and copy the entire directory to the slax-6.0.7/ subdirectory of partition 5. - Extract the file .../slax/changes.tgz . The extracted files may have extra leading directories in the path if you extract it at the wrong directory or if you place the content of the cdrom in a different directory. Move the changes/ directory to the correct slax/ subdirectory.
- Copy the file .../slax/changes/root/menu.lst to /boot/grub/ of the 4th partition, and edit it accordingly. The default setting assumes that the content of the slax cdrom is in slax-6.0.7/ of partition 5.
ps. I use bootable usb keys with eeepc 700 all the time, and did not find its driver module eeedrivers-607.lzm interfere with any other computer yet, so I make slax-cyut load it by default. But if you do have troubles with some hardware, please try moving eeedrivers-607.lzm out of the modules/ directory before trying any other major modifications or even buying a new hardware.
Interesting Uses of a Slax Computer
There are a few interesting boot options to know. You can try each of the following by pressing "e" and editing the command line at the grub boot menu. If you like some of these effects, you can edit boot/grub/menu.lst and add entries for your favorite effects permanently. See the end of this page for a complete example.
Recovery mode: remove the clause changes=/.../...
.
Changes will not be saved. Each boot will be fresh like booting for
the first time. This can be useful in a computer classroom, where a
windows computer would need a recovery card to restore the harddisk
to the original state on every boot. In fact all other linux
livecd's made into a live usb using the mk-boot-usb approach behave
in this mode by default.
Lightening fast mode: Add copy2ram
to the boot
command line. Everything will be copied to ram at boot time. It
takes a lot of ram (512MB might do if you don't have many modules;
1G is safer), boots more slowly, but runs faster once it finishes
booting. If you further type the command umount -a
in
a terminal, the usb key can then be removed. This is most suitable
for running a diskless kiosk or a diskless terminal that serves an
indefinite population and stays on for the whole day once it boots.
For example, this can be perfect configuration for a library
terminal whose only function is browsing.
See SLAX Cheatcodes for more options and be imaginative to come up with more possibile interesting applications of a slax computer.
Further Customization
This section is optional.
Slax is relocatable. It does not have to occupy a whole
partition to itself. You can put it in a subdirectory of a
partition that slax will share with other distributions. Besides
adding the directory prefix to the vmlinuz and initrd.gz phrases in
menu.lst, you just have to add the from=...
to the
list of boot parameters (and also remember to modify the
changes=...
parameter accordingly).
A Complete Example of the Boot Menu
Please compare the default boot menu created by mk-boot-usb, and a customized boot menu "vf2".
DSL | slax | otg | |
default | part 5 | part 6 | part 7 |
"vf2" | dsl-4.2.5/ of part 5 | slax-6.0.7/ of part 5 | part 5 |
The "vf2" version puts all 3 distributions into the same partition (partition 5), and defines 3 different entries for the same slax distribution.
The following are unorganized notes for myself.
- Add these lines to /etc/fstab:
tmpfs /var/run/xdmctl tmpfs defaults 0 0
tmpfs /var/run/dbus tmpfs defaults 0 0
Very important! Needed to prevent X from crashing caused by frequent writing! useradd -m -g users -s /bin/bash cyut ; echo 'cyut:' | chpasswd'
- Append ",cyut" to the 3 lines containing audio, video, and cdrom in /etc/group
- CC (Control Center). "System Administration". "Login Manager". "Convenience" tab. Assign cyut as auto login user.
- as root, edit /etc/httpd/httpd.conf, enabling userdir and index.php
- as root, add "cyut ALL=(ALL) ALL" to /etc/sudoers
- log out, be automatically logged in as cyut, and press a few enters to set up KDE. From now on, work as user cyut.
- Install firefox extensions.
cd ~/.kde/Austart ; ln -s /usr/bin/gcin
ln -s /var/www/htdocs/ckhung/b ckhung-books
cd /mnt/sd??/slax ; md5sum $(find base modules optional -type f | sort) > /root/md5sum.txt
cp /mnt/sd?4/boot/grub/menu.lst /root
- Backup /mnt/sd??/slax/changes/
- Most updated version of this page: http://frdm.cyut.edu.tw/~ckhung/p/mk-boot-usb/slax.en.php; the version you're reading: March 14 2011 08:57:23.
- Author: Chao-Kuei Hung at Chaoyang University Information Management Department
- Save our Earth; please reduce printing, make use of the unprinted side, and recycle.
- You are welcome to distribute this document in accordance with the Creative Commons Attribution-ShareAlike License or the Free Document License.