You are looking for http://www.pendrivelinux.com/. The site has all the information you need, I recommend you have a look at it. The following is what they suggest for installing a persistent Ubuntu 7.10 :
Download Ubuntu 7.10 (Gutsy Gibbon) and burn to a CD/DVD
Restart your PC from the CD/DVD
Open a terminal and type sudo su (to become root)
Type mkdir /projectinit
(to make our project directory)
- Type
cd /projectinit
(to change to the project directory)
- Type
gzip -dc /cdrom/casper/initrd.gz
| cpio -i (to extract the initrd.gz)
- Type
gedit init
(to edit the init file)
From gedit
, find the following section:
break)
break=premount
;;
esac
Directly above esac
add the following:
persistent)
PERSISTENT=yes
root_persistence=casper-rw
home_persistence=home-rw
;;
It should end up up like the following:
break)
break=premount
;;
persistent)
PERSISTENT=yes
root_persistence=casper-rw
home_persistence=home-rw
;;
esac
Save the changes to update the init file
- Type
find . | cpio -o -H newc | gzip -9 > initrd.gz
(to zip the new initrd.gz file)
- Then you can copy the new
initrd.gz
file to your usb flash drive, replacing the old file (or rebuild the iso to include the new file)
To boot persistently, at the boot menu press F6 to enter a custom boot option. Add persistent to the end of the boot string:
I cannot guarantee that this will work for a recent Debian but it should be a good starting point. Even if it doesn't you should be able to find all the information you need on the pendrive linux page.
Good luck!