I've been watching Hak5 since it hit Revision3 last year, and I've generally enjoyed the show. Recently, host Darren Kitchen talked about creating a persistent Backtrack boot-able flash device. Since I'd be using this with my EeePC (or another laptop), I decided that the idea of running an OS off a thumb drive for any period of time was scary, so I decided to go the SD Card route.
Unfortunately, Revision 3 doesn't provide good show notes for how this was done, Hak5.org is down, and Backtrack's own page on a persistent USB drive is completely empty. The provided content is taken almost verbatim from Darren's presentation on the linked video above, and I'll embed the video after the instructions. I just felt that a write-up would be convenient.
- Download the Backtrack4 ISO
- Set up bootable media with Backtrack, either burn a CD, or a thumb drive using unetbootin
- Boot BT4, put your SD Card in your computer and find out what device it mounted as. Enter
dmesg | grep hd.\|sd.
at the command prompt, the bottom entries will likely be the correct ones. On my system, it was /dev/sdc so that's what I use. - Run
parted /dev/sdc
(I vary from Darren on this) - Type
print
at the command prompt, odds are you'll have 1 partition. Delete all the numbered partitions with therm
command. - Create the first filesystem with
mkpartfs primary fat32 0 2.5GB
This will create a two and a half gigabyte, fat32 partition as your main data store. - Make Partition 1 bootable with
set 1 boot on
- Create Partition 2 with
mkpart primary ext3 2.5GB 100%
. This will fill the rest of the device with a empty partition. I used an 8GB drive, but the 100% will fill the rest of the drive. - Exit parted with
quit
- Run
mkfs.ext3 -b 4096 -L casper-rw /dev/sdc
to create the persistent area on the storage. - Run
mkdir /mnt/sdc1
- Run
mount /dev/sdc1 /mnt/sdc1
to mount the first partition you created. - Run
rsync -r /media/cdrom0/ /mnt/sdc1
to copy all the files from the boot media to the boot partition. This will take some time. - Rum
grub-install --no-floppy --root-directory=/dev/sdc1 /dev/sdc
to install grub on your sd card. - Edit /mnt/sdc1/boot/grub/menu.lst in your favorite editor
- Change the line 'default 0' to 'default 4' to load in persistent mode by default.
- To the end of the kernel line for the Persistent Live CD option, add 'vga=0x317'
- Shutdown and reboot.