So, I've been having a rather hard time configuring this because the flash drives totally screw up when you try to safely power off the system, so I figured I'd tell you how to do a persistent usb install without this... trouble. You'll need to have an 8gb or bigger flash drive for this to work properly.
First, Download the BackTrack 5 R2 iso image to your computer (assuming that you are on backtrack linux) into your root home directory.
Second, Download the "unetbootin-linux-568" executable from the unetboot website.
Third, Stick in your flash drive and edit the partition tables like this, enter these commands in order:
fdisk /dev/sdb (##Or the device letter of your flash drive)
d
n
p
1
enter
enter
t
b
a
1
w
Fourth, You need to format that new partition to fat32, but before we do this, you MUST safely remove the drive and reinstert the drive so it updates the partition tables, doing partprobe most of the time doesn't work, so just take it out and put the usb back in and then run this command:
mkfs.vfat -F 32 -n BT5 /dev/sdb1
Fifth, You need to run the unetbootin script, and to do this you need to do these in sequence:
chmod 777 ./unetbootin-linux-568
./unetbootin-linux-568
#choose the "Diskimage" option and browse for the right .iso with the "..." button
#type in 9999 in the whitespace for the "preserver files across reboots" whitespace
#make sure that /dev/sdb1 is selected and press OK
Sixth, After creating the image on the flash drive, you have to modify your casper-rw file with this command:
tune2fs -j /media/BT5/casper-rw
Seventh, You have a flash drive that is ready to go! If you are ever having any problems, just make sure that you run this command after you shut off your computer on your linux machine:
fsck /media/BT5/casper-rw
#or, if you didn't enable journaling, you can run this "yes | fsck /media/BT5/casper-rw" since you will have about a thousand entries that you'll need to type y for, or just lay down on the y key until it's done.
And then you have it, a BackTrack 5 R2 usb that you can edit and distribute!
You can also change the boot order options by modifying the "syslinux.cfg" file in the drive's root directory.
Now, here is where the real fun comes in, is if you actually want to distribute it, you'll have to do this:
First, Insert your original flash drive (and if you tested it, make sure you run fsck on it before you copy it), and insert another flash drive and run the following command:
dd if=/dev/sdb of=/dev/sdc bs=1024K
And then wait like an hour and you've got yourself an entire copied disk, including everything that you wrote from the time you used the flash drive before (it's nice for updating metasploit and running apt-get update/upgrade before teaching a class, becuase then they all have up to date flash drives and you don't have to run each command yourself, by yourself)
And there you have it, again. Hope this helps :3 (And I hope this is formatted correctly)