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: http://www.itsolutionskb.com/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.
We now need to delete the /dev/sdc1 partition and create 2 new partitions for the /dev/sdc USB Drive:
root@bt:~# fdisk /dev/sdcWe now format the linux partition with mkfs.ext2, mount it and create “changes” folder:
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
root@bt:/# mkfs.ext2 /dev/sdc2On 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:
root@bt:/# mkdir -p /mnt/sdc2
root@bt:/# mount -t ext2 /dev/sdc2 /mnt/sdc2
root@bt:/# mkdir /mnt/sdc2/changes
Format the partition to FAT32Now we have to make our 2GB USB Drive bootable and keeping the changes on our second partition:
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/
chmod +Xx /mnt/sdc1/boot/syslinux/liloAppend the changes to reflect the Linux EXT2 partition we created before:
chmod +Xx /mnt/sdc1/boot/syslinux/syslinux
nano /mnt/sdc1/boot/syslinux/syslinux.cfg
LABEL BT4As 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.
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
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/shNow you have a full Backtrack 4 installation on your USB Drive that will keep all the changes we make.
root@bt:/# sh /mnt/sdc1/boot/bootinst.sh
root@bt:/# reboot
No comments:
Post a Comment