How to create your custom live-cd/dvd/usb under debian or ubuntu

$ sudo echo “deb http://www.geekconnection.org/remastersys/repository debian/” >> /etc/apt/sources.list
Next update your repos:$ sudo aptitude update$ sudo aptitude install remastersys$ sudo remastersys
and select (to make a distributable livecd/dvd of your system
at the end of process the remastersys will generate a iso file named customdist.iso in the directory :
/home/remastersys/remastersys/

In order to boot from your usb flash drive, your bios must support booting from an usb device,
and you have to install on it a boot loader like grub or a syslinux on it.

this tutorial focus on the use of syslinux:

First of all, get syslinux using aptitude or apt-get like:$ sudo aptitude install syslinux

Plug in the USB memory stick. The USB device should also be visible by the command$ sudo fdisk -l

Then create a FAT16 partition on the USB flash drive, using fdisk.
here we support that the usb reside on /dev/sda.

$ sudo fdisk /dev/sda
Create a new partition (enter n):
Choose Primary partition (enter p), Partition number (enter 1).
The size of the partition should be at least as larger as the LiveCD/DVD you want to install on the USB device.
Afterwards, change the type (enter t) of first partition (enter 1) to W95 FAT16 LBA (enter e),
and make first partition active (enter a and select 1).
Before writing the partition table to the USB flash drive (enter w), you can print the changed settings (enter p).

Now format the first partition (/dev/sda1) as FAT16:$ sudo mkfs.msdos /dev/sda1