Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General > Member Success Stories
User Name
Password Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.


Search this Thread
Old 12-23-2010, 01:16 PM   #1
Jack Sparrow
LQ Newbie
Registered: Dec 2010
Posts: 8

Rep: Reputation: 1
Success: live cd and flash disk with all the tools I needed how I want it

I have used linux for around the past 10 years now, and as my only operating system now for around 3 months (Ubuntu desktop, linux smart phone). I LOVE it.

For the past two weeks I've been screwing around with live CDs, specificly getting all the tools I need on one, and taking off everything else that would slow it down. Before I start, making one of these is vastly EASIER if you have a linux desktop system to make one it.

The seemingly easy way is mowzying on down to, selecting a few packages you want. without ranting too much, slax is a pain the the ass. I gave up after a while.

Assuming your running Ubuntu, We will use the ubuntu customization kit:

Lets start with UCK we use to build this. NOTE, I also added gfxboot-dev, because this has been a requirement since whoever maintains the gfxboot package decided to split gfxboot into gfxboot and gfxboot-dev. The tools needed by UCK are in gfxboot-dev but the dependencies never got updated. So if you don't install it, the program will run, but all your builds will fail.
apt-get install uck gfxboot-dev
NOW, since you've used apt, you have all the dependencies in place. version 2.4.0 is needed for Ubuntu 10.10, due to some bugs in 2.2.x. As of this writing it is NOT in the repositories. Go downloaded it manually.

Next you need an .iso to use as a start point. I recommend lubuntu because its lightweight and far quicker, but still runs the GTK2+ libraries.

Now, run UCK.

It asks you which language you want to use. Really pick the one you use most and leave the rest unselected. Lang packs take up space.

It will also ask you if you want to customize the CD, say yes, and it asks if you want to delete the windows files say yes.

Now if will give you three options, a command line in a chroot of your CD, editing the packages which opens synaptic package manager, and continue building, which builds the CD.

start by adding all the packages you need with synaptic, and removing the ones you don't(remember 700 megabyte limit on CDs).

Now open up the command line. Some tools don't have .deb installers, so if you want to put anything else on the disk, this is how.

the chroot is located in:
so move anything you want inside there, but make sure your root to do it. then from inside the chroot, you can install software.

Truecrypt for example is installed this way. Basicly
tar -zxvf truecrypt*.tar.gz
rm truecrypt*.tar.gz
sudo cp truecrypt* /home/USER/tmp/*root
now from inside the command prompt the installer gives you(chroot), type
chown root:root truecrypt*
and BAM it installs. you can now delete the installer.

a few other things, as some programs need to run in root in ubuntu, like wireshark. Again its real simple, but if you don't, no interfaces show up.

cd /usr/bin
mv wireshark wireshark-bin
echo gksu wireshark-bin > wireshark
chmod 755 wireshark
then before you exit the command line, REMEMBER to do the following.
apt-get udpate
apt-get upgrade
apt-get autoremove
apt-get autoclean
now exit, select option 3 and build your CD. If you forgot something, you can use your already built CD as a start point for the next one. I am sure any Debian based distro that relies on apt and dpkg will work.

At this point, you've already burned a CD, but you want more, a CD is great, but they are still rather bulky, and prone to breakage.

SO, we take your newly minted custom CD and we make it boot of a flash disk. The first thing to do, is find a suitable flash disk. make sure it works, its either empty, or has nothing you don't mind erasing on it. Oh, it should be at least two gigabytes.

I like to do two partitions, one for the system to boot, and another for data. a little more convienant and secure. you can use either the Disk Utility in Ubuntu, or fdisk to partition your hd the way you want it. MAKE SURE YOU USE EXT2 for the boot partition. journaling file systems and flash memory is a real bad idea, its unnecessary slow, and can damage your drive.(or cause premature death).

 apt-get install extlinux
- bootloader you'll need later.
Adapted from here:
Re-partition and format the USB drive. Ensure that the first partition is at least 1GiB in size and marked bootable. Any remaining space can be divided as necessary. When formatting choose ext2, do not put a journaling filesystem onto the USB device.

if you made the partitions already in gnome, they are automaticly formatted and you can skip this.
cfdisk /dev/sda
mkfs.ext2 /dev/sda1
mkfs.ext2 /dev/sda2
careful, this is rather old, and /dev/sda1 is the name of the HD you boot off if you have a SATA drive. find out which drive your flash disk is. Its going to be /dev/sd something or another, most likely b through g. subtitute all mention of /dev/sda with this.

for YOURCD.iso use the name of the .iso you made in the first half, or any other .iso of a bootable linux cd should work.
Mount up the fresh partition and the ISO image.
mkdir /mnt/usb_disc
mount /dev/sda1 /mnt/usb_disc
mkdir /mnt/live_cd
mount -o loop /tmp/YOURCD.iso /mnt/live_cd
cd /mnt/live_cd/
cp -aR casper disctree dists install pool preseed .disk /mnt/usb_disc
There is no need to copy the isolinux informations as extlinux will be used.
cd /
mkdir /mnt/usb_disc/extlinux
extlinux -i /mnt/usb_disc/extlinux
OK, here is the tricky part. there is no extlinux.conf by default. make one, copypaste from the line below.
Now edit the config file /mnt/usb_disc/extlinux/extlinux.conf to read something like this.
DEFAULT /casper/vmlinuz
APPEND  file=preseed/kubuntu.seed boot=casper initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram0 rw quiet splash --
next, where it says initrd.gz change that to initrd.lz

then you are done, unmount everything, and your thumb drive boots your custom installation.

Last edited by Jack Sparrow; 12-27-2010 at 03:50 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
livecd-tools created usb flash disk not booting prabhatsoni Linux - Software 3 11-05-2010 06:21 AM
LXer: Are Proprietary Tools the Key to Linux Desktop Success? LXer Syndicated Linux News 0 07-30-2009 03:00 AM
copy a file to the flash disk and extract it from the flash disk indu.a Linux - Kernel 2 11-15-2006 04:22 AM
Success, Long live Tux. magik400 Member Success Stories 1 04-05-2006 05:13 AM
SB Live 24 with SuSE 9.3 - anyone having success? alvez Suse/Novell 7 01-19-2006 10:38 PM

All times are GMT -5. The time now is 12:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration