BackTrack4 SD Card with Asus Eee PC

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.

  1. Download the Backtrack4 ISO
  2. Set up bootable media with Backtrack, either burn a CD, or a thumb drive using unetbootin
  3. 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.
  4. Run parted /dev/sdc (I vary from Darren on this)
  5. Type print at the command prompt, odds are you’ll have 1 partition. Delete all the numbered partitions with the rm command.
  6. 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.
  7. Make Partition 1 bootable with set 1 boot on
  8. 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.
  9. Exit parted with quit
  10. Run mkfs.ext3 -b 4096 -L casper-rw /dev/sdc to create the persistent area on the storage.
  11. Run mkdir /mnt/sdc1
  12. Run mount /dev/sdc1 /mnt/sdc1 to mount the first partition you created.
  13. 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.
  14. Rum grub-install --no-floppy --root-directory=/dev/sdc1 /dev/sdc to install grub on your sd card.
  15. Edit /mnt/sdc1/boot/grub/menu.lst in your favorite editor
  16. Change the line ‘default 0’ to ‘default 4’ to load in persistent mode by default.
  17. To the end of the kernel line for the Persistent Live CD option, add ‘vga=0x317’
  18. Shutdown and reboot.

EeePC Notes:

  1. My EeePC is an original 8G, meaning that it’s running a Celeron M, not an Atom, and it has the smaller (6”) screen.
  2. To select your boot device from the Eee PC Menu, hit the ESC key when the system starts to boot (these things boot fast, so hit it quick) and choose the ‘USB2.0CardReader’ option to boot from SD. If you’re booting from a thumbdrive and your thumbdrive has a U3 partition, odds are you’ll want the first one on the list. If it refuses to boot it, reboot and try the other.
  3. The system is currently booting into a text console for me, not the GUI. If I want the GUI, I can just type ‘startx’ and it comes right up. I’m trying to solve this issue, and when I do, I’ll update this post.