How do I install Persistent USB Backtrack 4 -- The Perfect Install??
However, I soon realized that Backtrack Live DVD iso. Contains outdated Metasploit framework and hence I was not able to use the facility of the framework to the fullest.. So I Googled and found out ways to make Backtrack as my Live USB rather than CD so that I could save the changes in it. However soon I again realized that though I could make a live usb, it would not store my information that I kept in it… And to make the information store, I had to make it persistent by following quite a few of stuff and later I found out with countless errors and trials the one and proper way of making a persistent USB drive… Actually there are a lot of tutorials to tell you how to do this, however I found all of them faulty when I tried to implement them… so finally I am writing my own tutorial of how to do it…
TOOLS Reguired..
1. A Live Backtrack DVD
2. One 4gb pendrive, ( you can have larger too .)
3. A computer that supports USB boot.
4. Patience….
First of all,
Type
dmesg | egrep hd.\|sd.
This will give you the information in which device is your USB located..
Possibly its /dev/sdc
Anyways, it may be different for yours..
So I’ll continue it as /dev/sdc :
We now need to delete the /dev/sdc1 partition and create 2 new partitions for the
TOOLS Reguired..
1. A Live Backtrack DVD
2. One 4gb pendrive, ( you can have larger too .)
3. A computer that supports USB boot.
4. Patience….
First of all,
Type
dmesg | egrep hd.\|sd.
This will give you the information in which device is your USB located..
Possibly its /dev/sdc
Anyways, it may be different for yours..
So I’ll continue it as /dev/sdc :
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/syslinux
nano /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
0 Response to How do I install Persistent USB Backtrack 4 -- The Perfect Install??
Post a Comment