How to create a live boot CD containing your favorite Linux Distro 

http://www.babytux.org/articles/howto/how2livecd.php

Buddhika Siddhisena
Updated : September 16, 2003
Created : August 7, 2003

Motivation - Why? 

Wouldn't it be cool to have a bootable version of Linux running totally off a CD, no hard disk required!. You could probably pack your collection of mp3s along with a small linux desktop containing xmms. Perhaps load a couple of games like Tuxracer, Tuxpuck or Frozen Bubble to play at a friends house who doesn't have linux. May be your friends hard disk running that NO GOOD OS, crashed with a blue screen and wont boot and needs to be rescued. Better yet you want to introduce your friends to the wonderful world of Linux.

But most of the above mentioned can be achieved using some great projects such as Knoppix (www.knoppix.org) and Demo Linux (www.demolinux.org). So why go through all the trouble to build your own live CD from scratch? For one thing its great learning experience that can help you to get an insight into what makes linux tick, under the hood! Then there is the advantage of being familiar with your favorite distro and the tools it provides and a chance to let your friends try it out too.

Before we start - What you'll need 

  1. Installation CDs of your favorite distro.

  2. Free hard disk space - 1 partition will be used to install a full linux distro 1 partition will be used to install the distro to be put on the CD (about 700MB) 1 partition for swap

  3. Download the latest version of Busybox from http://www.busybox.net. It enables us to run a few essential linux commands easily requiring less hard disk space.

  4. A CD-RW to test burning various images and a CD burner (duuuh!)

  5. Optionally a virtual machine like VMware (commercial www.vmware.com) or Bochs (opensource bochs.sourceforge.net) will help in testing the iso image

  6. Optionally download my sample scripts and initrd file to save some time.

  7. Working knowledge on using linux at a command line level.

  8. Lots of patience :)

DISCLAIMER: The steps outlined in this document come with no guarantee (or warranty) that it will work, and what ever you do to your system is at your own risk! I hold no responsibility. Please back up your data always (or better yet use a different hard disk).If this makes you uncomfortable stop reading any further!

phew! now thats out of the way lets get to it!

Steps involved - Overview 

I've made my linux LiveCD using Mandrake Linux 9.0 (and later 9.1 with some changes), so I will explain it for that. I doubt it will be any different for Redhat. For other distros such as Debian or Suse you will have to improvise as necessary (commands for package management, file paths etc.)

  1. Install a full version of Mandrake Linux with kernel sources,development tools (such as gcc, make, etc.), cd burning tools (cdrecord, mkisofs) (Lets call $MAIN)

  2. Install a 700MB version of Mandrake Linux to a fresh partition containing only the required packages for the LiveCD (Lets call $LIVECD)

  3. Boot into $MAIN and compile a new kernel with support for ISO9660, initrd and ramdisk built in.

  4. Create an entry in the boot loader (lilo) to use the new kernel we compiled to boot $LIVECD

  5. Compile busy box so that it can later be copied to our $INITRD

  6. Create an initial RAM disk (initrd), format it using ext2 (lets call $INITRD) and mount it

  7. Make necessary changes to $LIVECD so that it boot in read-only mode as required for a Live CD and test setup

  8. Modify $INITRD so that it can boot off a $LIVECD and test it

  9. Make a bootable Linux CD ISO image of $LIVECD using the isolinux/syslinux method and burn it.

  10. Put in further configuration/optimization scripts to streamline and improve the system

    [ ... rest ommited ...]

The Linux boot process in a nutshell 

An understanding of the linux boot process is important before we continue as it will help us to understand and debug if something doesn't work.

First lets see how the usual linux boot process works.

Next lets see how our LiveCD boot process works.

documented on: 2007-08-08

Roll your Desktop into a USB stick/CD 

http://linuxgazette.net/113/kapil.html

By Kapil Hari Paranjape

Here is a short course (with some excursions) to help you take your existing Desktop, roll it into an ISO pipe and smoke a USB stick or CD. This is not a task for the faint-hearted - there are no automated scripts in here!

Part of the reason for this hands-on approach is that each desktop system will have its own quirks, so writing scripts which handle the various conditions which might arise is painful. Secondly, there are numerous choices possible - you must mix your own. Finally, I must confess that I do not feel energetic enough to write the scripts at this point. Instead, you have this article!

So if you have spent a lot of time fine-tuning your configuration and want to waste some more time putting it onto a (re)movable drive - read on.

[ ... rest ommited ...]

Published in Issue 113 of Linux Gazette, April 2005

Comments 

It shows vividly how painful it is without Linux Live. http://www.linux-live.org/

documented on: 2007-10-21