In this article we will describe how we can create a bootable Backtrack 4 USB Drive that will save all the changes we make on the USB itself. In this scenario we will use 2 USB Drives. One USB drive of 1GB and the 2GB USB drive which will hold our changes.
Firstly we need to create a bootable USB Drive on the 1GB USB Drive and boot our machine (A DVD Drive can be used also)
Instructions on how to do this can be found on the following link: 2009/04/how-to-make-backtrack-4-boot-from-usb/
Secondly we will need to to prepare our 2GB USB Drive with 2 partitions, one for the USB Boot with (bt4 and boot folder) FAT32 and the other one EXT2 to keep our changes.
As you can see in the above screenshot the two USB devices are listed as /dev/sdb1 for the 1GB bootable USB Drive and /dev/sdc1 for the 2GB drive.
We now need to delete the /dev/sdc1 partition and create 2 new partitions for the /dev/sdc USB Drive:
root@bt:~# fdisk /dev/sdc
Command (m for help): d
Selected partition 1
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2813, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2813, default 2813): +1024M
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)
Command (m for help): a
Partition number (1-4): 1
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1489-2813, default 1489):
Using default value 1489
Last cylinder, +cylinders or +size{K,M,G} (1489-2813, default 2813):
Using default value 2813
Command (m for help): w
The partition table has been altered
We now format the linux partition with mkfs.ext2, mount it and create “changes” folder:
root@bt:/# mkfs.ext2 /dev/sdc2
root@bt:/# mkdir -p /mnt/sdc2
root@bt:/# mount -t ext2 /dev/sdc2 /mnt/sdc2
root@bt:/# mkdir /mnt/sdc2/changes
On the first partition we need to copy BT4 and boot folders from the 1GB USB Drive to our 2GB USB Drive first partition /dev/sdc1:
Format the partition to FAT32
root@bt:/# mkdosfs -F 32 /dev/sdc1
root@bt:/# mkdir -p /mnt/sdc1
root@bt:/# mount -t vfat /dev/sdc1 /mnt/sdc1
root@bt:/# cp -Rf /mnt/sdb1/boot/ /mnt/sdc1/
root@bt:/# cp -Rf /mnt/sdb1/BT4/ /mnt/sdc1/
Now we have to make our 2GB USB Drive bootable and keeping the changes on our second partition:
chmod +Xx /mnt/sdc1/boot/syslinux/lilo
chmod +Xx /mnt/sdc1/boot/syslinux/syslinuxnano /mnt/sdc1/boot/syslinux/syslinux.cfg
Append the changes to reflect the Linux EXT2 partition we created before:
LABEL BT4
MENU LABEL BT4 Beta – Console
KERNEL /boot/vmlinuz
APPEND vga=0×317 initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw quiet changes=/dev/sdb2
As you can see we had put /dev/sdb2 partition because on the next boot we will remove the 1GB USB drive that it currently has the /dev/sdb partition and our new bootable USB Drive will use /dev/sdb.
The last step is to write our MBR Boot record to make our USB Drive bootable:
As we notice running bootinst.sh on backtrack 4 we get an error as follow
root@bt:/# sh /mnt/sdc1/boot/bootinst.sh
/mnt/sdc1/boot/bootinst.sh: 27: Bad substitution
To fix this we need to force symbolic link the /bin/bash with /bin/sh and reboot the system:
root@bt:/# ln -sf /bin/bash /bin/sh
root@bt:/# sh /mnt/sdc1/boot/bootinst.sh
root@bt:/# reboot
Now you have a full Backtrack 4 installation on your USB Drive that will keep all the changes we make.



















































drcliff







May 18, 2009
That’s wonderful Glafkos
I followed your steps one-by-one it’s like you customized these settings to my machine
works like charm
i’ll have to try the changes thing
mmmm regarding the changes=/dev/sdb2
isn’t there a way to make this variable change from time to time ?
for ex.
if i boot again with another flash drive plugged in , shouldn’t this make some sort of confusion?
thank you
[Reply]
Glafkos Charalambous Reply:
August 3rd, 2009 at 10:33 pm
Hello,
It will create a confusion only and if you already have a usb attached. Be sure you boot only with Backtrack USB so it can load the persistent partition on /dev/sdb2 and then plug in any other usb drives.
Regards,
Glafkos
[Reply]
August 12, 2009
Hello,
I wonder is there are any problems with performance/speed of the backtrack when it’s on the usb drive. I mean my usb drive isn’t too fast. Is is a problem ?
(sorry for bad english)
Thanks
[Reply]
August 21, 2009
Sick tutorial man! I don’t have as much experience with Linux so something like this was necessary to install BT onto my netbook which ahs no CD Drive. Now I erased my Windows OS and have BT running as the sole OS on my Acer Aspire One. I really appreciate this tutorial and will be spreading the link around. It was very helpful! Thanks again!
[Reply]
KLAUS Reply:
January 14th, 2010 at 3:07 pm
lol learn linux basics before you use BT.
[Reply]
snadman Reply:
January 16th, 2010 at 4:05 am
What better of a way to learn than on an advanced OS such as BT. I’ve learned more from using it than I could have from any book.
[Reply]
September 14, 2009
ok im stuck right here cp -Rf /mnt/sdb1/boot/ /mnt/sdc1/ and have been for 2 days it tells me that cp: cannot stat `/mnt/sdb1/boot/’: No such file or directory but if its not there how am i booted up on it and the usb drive is sdb1 so im lost any ideas?
[Reply]
Dan Reply:
December 4th, 2009 at 8:00 am
With mine install, it mounts it under /media/cdrom/boot instead of /mnt/sdb1/boot/. hth
[Reply]
November 6, 2009
Its a nice tutorial, I have a USB drive of 8GB can I do full installation on one usb drive if YES…then HOW???
Could u make another tutorial entire process on one USB drive by the way to let u know I am new in linux enviornment.
[Reply]
November 19, 2009
Hi.
I would appreciate if you could also show how to make install on only one usb instead of two.
Many Thanks
[Reply]
Locksmith Reply:
November 27th, 2009 at 11:45 am
You shouldn’t have to use two drives, you can partition on one drive and do the same thing. Check some of the backtrack3 persistent tutorials, they’ll work as well.
You essentially fdisk two partitions on one drive, then install backtrack to one, and tell the other to use the second partition to save things too. This tutorial just gave a different spin on it.
[Reply]
Glafkos Charalambous Reply:
November 27th, 2009 at 1:51 pm
You don’t use 2 usb drives for persistent installation but just one. I would suggest that you read the post once again
[Reply]
November 30, 2009
I am a noob. When doing this, is it possible to continue using Windows 7, XP, or similar OS when the USB drive not attached?
[Reply]
Glafkos Charalambous Reply:
December 1st, 2009 at 12:08 pm
Hello JCJ,
You can still run any operating system you have installed on your hard drive. You will only boot the Backtrack 4 installation from USB and u will write the changes directly to the second partition of your USB stick.
Regards,
Glafkos
[Reply]
January 18, 2010
OMG … Why every noob wants to install Backtrack ?
They never had any contact with an user friendly Distribution where you don’t have to use for every little task the shell…
Folks …. please listen …. Install at first a user/noob friendly linux and then go on and learn to use Backtrack!
[Reply]
Psyco Reply:
January 21st, 2010 at 3:02 am
true said, I guess they read that its a “hacker” os and think the apps/hacking will be ease-of-use, u need to know linux cli syntax to work it guys
[Reply]
January 29, 2010
Yes one of the best tutorials….
As far as the noobs are concerned, dont forget that one day we all used to be noobs…
[Reply]
February 1, 2010
i copy iso to usb but i dont have bootinst.bat if any body have it pls send it to me on designergraphics [at] ymail [dot] com
[Reply]
February 11, 2010
Hmph, cant get it to install on my 4gig sandisk. Thinking its the retarted software that came with it. i removided it but it screwed up the memory. only have 3.8 gigs now. Got the boot to run on the flash drive, but cant save anything on it. Thats what this tut is for right? well, wondering if anyone else has the same problem, or has any suggestions. Get stuck when adding a new partition (command “a”) says i need to delete the partition on disk and then add extended partition. Whish is what i swear i just did… Thanks!
[Reply]
trustnoone Reply:
February 11th, 2010 at 3:17 am
ok, now i reealize that the max cylinders i can partition is 1-490. Odd, its a 4 gig flashdrive, why is it only saying it has 490 cylinders?
[Reply]
February 26, 2010
root@bt:/# cp -Rf /mnt/sdb1/BT4/ /mnt/sdc1/
I have BT4 final and it hasn’t any folder called BT4.. will this work?
[Reply]
March 23, 2010
Hi,
When i try to copy the boot and BT4 files (
root@bt:/# cp -Rf /mnt/sdb1/boot/ /mnt/sdc1/
root@bt:/# cp -Rf /mnt/sdb1/BT4/ /mnt/sdc1/
)
cp gives me an error saying no such file or directory “/mnt/sdb1/boot/”
don’t understand why, checked the usb drive, unetbootin made is job correctly as always, and the boot directory does exist…
Any thoughts?
Thank you very much
b.t.w: I also have bt4 final and there is no BT4 folder
[Reply]
March 25, 2010
On the BT4 Final Release 2010-01-11 .iso there no /BT4 but a /casper directory.
cp -Rf /mnt/sdb1/BT4/ /mnt/sdc1/
should be replace by
cp -Rf /mnt/sdb1/casper/ /mnt/sdc1/
Also there is no /boot/syslinux but a /boot/grub directory. What is the procedure to update the /boot/grub/menu.lst and add the changes to reflect the Linux EXT2 partition?
How to make the 2GB USB Drive bootable?
[Reply]
May 31, 2010
Hi,
as i see a lot of people having problem making persistent usb with bt4 while running windows as main OS on there comp.
As someone said before learn to use linux first by installing ubuntu or kubuntu, as these are easy to learn OS.
But if you love that slow microsoft bluescreen system to much to cross over to better OS then try “lili usb creator” it’s freeware and is able to create bootable persistent USB for most Linux OS.
[Reply]