Search Form

How To: Installing BackTrack 4 R1 to a USB Flash Drive

Introduction:

In this tutorial you will learn how to install the latest version of BackTrack (BackTrack 4 R1) to your USB flash drive. Not only will you be able to boot BackTrack off of a flash drive, but it will also allow you to have persistent changes. This tutorial will also work for previous versions of BackTrack.

bt4-logo

Tools and Material:

  • USB Flash Drive – 8GB minimum
  • DVD of BackTrack 4 R1 (or previous version)

The reason why we recommend an 8GB flash drive is that after everything is installed from the disk, you wouldn’t have much room for installing anything additional if you were to using a 4GB flash drive.

Partitioning the Flash Drive:

All of this tutorial will be done from the command line. So the first step is to pop in the disk and flash drive and select the first option when you are greeted by the BackTrack boot up menu. This will eventually leave you with a command prompt, which is where we will begin.

Now that we have a prompt, we must determine which drive our flash drive is. We accomplish this by running the command:

dmesg | egrep hd.\|sd.

This will give us a list of all drives on the machine. From there you need to select which one is yours. I will use sda in my examples, but yours may be different and you should substitute as necessary.

We will be using fdisk to create the partitions for our Flash Drive.

fdisk /dev/sda

Delete the existing partitions, there may be more than 1. Input the commands that are bolded.

Command (m for help): d
Partition number (1-4): 1

Create the first partition

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder: <enter>
Using default value 1
Last cylinder, +cylinders or +size{K,M,G}: +2000M

Create the second partition:

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder: <enter>
Last cylinder, +cylinders or +size{K,M,G}: <enter>

Set the partition type of the first partition to vfat/fat32

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Set the partition type of the second partition to Linux

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 83

Set the first partition to active

Command (m for help): a
Partition number (1-4): 1

Write out the current partition table to the disk

Command (m for help): w

Format the partitions, substituting your drive for sda as neccessary

mkfs.vfat /dev/sda1
mkfs.ext3 -b 4096 -L casper-rw /dev/sda2

Mounting and Copying Files:

Next we need to mount the flash drive that we just made partitions on

mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1

Then we will use rsync to copy the files from the DVD to the flash drive.

cd /mnt/sda1
rsync -r /media/cdrom0/* .

Installing grub:

Now that we’ve copied all of the files over, we must now install a bootloader on the flash drive.

grub-install –no-floppy –root-directory=/mnt/sda1 /dev/sda

Persistent Changes:

Now that grub is installed, we are technically done, but I like to make some changes to the grub boot menu so that it picks persistent changes mode by default.

cd /mnt/sda1/boot/grub

nano menu.lst

You will need to change the default to 4.

Tweaks:

One thing I like to do is enable networking by default as it is normally disabled. To accomplish this, you need to boot from the actual flash drive and then run the command:

/usr/sbin/update-rc.d networking defaults

Closing:

BackTrack is a great resource for checking the security of your home network.  It really provides you with pretty much every tool to audit your home network. Now you will be able to take you flash drive and audit any network.

backtrack4_r1

Update:

The public version of BackTrack R1 has been released and can be found here: http://www.backtrack-linux.org/downloads/

18 Comments... What's your say?

  1. plz give video tutorials for that. And i am linux learner so plz give as possible you to give tuts.
    thanx……………..

  2. nv.. newbie mistakes!

  3. I am trying to install backtrack4 R2 from a USB FDD 2GB (used instead of a boot CD) to another USB FDD 16GB (To be installed on).
    the only step i ve change was rsync -r /media/cdrom0/* . to rsync -r /media/cdrom0/

    when i boot from the 16gb flash drive i get the grub boot screen and cannot get through that.

    any advise would be useful

  4. dear bro,
    s0rry for my bad english!
    i’m an Arab.
    and i am completely new to BACKTRACK thing.
    i want to know if it is necessary to install Linux OS UNBUNTU or whatever before i’d be able to use Backtrack 4 R1 which i’ve just downloaded?

    • No, you don’t have to have Ubuntu or any other version of Linux installed. This operates by itself and will not do anything to your existing installation of Windows. If you follow the guide correctly, you will be booting off of the flash drive instead of your hard drive (where you have windows installed). When you’re done messing around, just unplug the flash drive and it can boot back into the operating system installed on your hard drive.

  5. Problem solved, did mistake and writed ‘casper’ not ‘casper-rw’ 🙂

  6. rsync -r /media/*. didn’t work for me. I had to use
    rsync -r /media/ /dev/sdb1

    Great tutorial 🙂

  7. please note guys that this is not a persistent install

  8. Also looking for bt4 r1.

  9. Thansk for the artice, but has the public release of R1 been made available anywhere yet? have been through their site, but not there yet? Which version did you use for this? The article states R1.

Trackbacks

  1. […] This post was mentioned on Twitter by ChrisTWL, Cory Blomenkamp, Josh, tcpflorida, Tom Gowing and others. Tom Gowing said: Review: How To: Installing BackTrack 4 R1 to a USB Flash Drive – http://bit.ly/cFW6um […]

Join in, share your thoughts

You must be logged in to post a comment.