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.
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.
Update:
The public version of BackTrack R1 has been released and can be found here: http://www.backtrack-linux.org/downloads/
plz give video tutorials for that. And i am linux learner so plz give as possible you to give tuts.
thanx……………..
nv.. newbie mistakes!
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
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.
Problem solved, did mistake and writed ‘casper’ not ‘casper-rw’ 🙂
I’m glad you liked the article. If you want to expand your skill set a bit more I wrote a follow up article (http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/) that involves using some of the tools in BackTrack. The followup is a lot more in depth than this article.
rsync -r /media/*. didn’t work for me. I had to use
rsync -r /media/ /dev/sdb1
Great tutorial 🙂
The command right above rsync (cd /mnt/sda1) puts you in the correct directory so the . after the rsync command will work. In your case, you would have typed cd /dev/sdb1. The way you did it just enables you to explicitly say what directory to rsync to.
Chris thumbs UP! Your toutorial helped me to make my OCZ Rally 16GB working! Tryed a lot of other methods that always works on other USB’s but all failed. Not this one 🙂
But hmm Chris my BT4 don’t remember any changes, why ? 🙁
please note guys that this is not a persistent install
Also looking for bt4 r1.
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.
The public release has not been made available yet. BackTrack 4 R1 was done as a pre-release to attendees at Black Hat, but should be released to the public in the next week or so. These instructions will also work for the previous version of BackTrack.
i used bt4 r1 and its cool without my hdd because my 500gb sata is going down.my problem is my mouse is going crazy when im 5hrs to use..how to prevent this error?thanks
What do you mean by it goes crazy? Have you tried with any other mouse to see if you get the same result?