Backtrack4-Beta : USB Installation With Persistent Changes

| 31 May 2009 | |
A lot people have trouble with their Backtrack that save changes their settings after reboot the system from a thumb drive. I do have the same problem and here is a 'how-to' to make a persistent changes inside my USB thumb drive instead of putting *.lzm file/s into modules folder.

What is your working environment and setup?
My working environment is under Vmware Workstation 6.5.2 with Backtrack4 installed. This is the best choice for me since my laptop have trouble to boot from a Backtrack Live-CD, somehow, it does not make any difference of command between Live-CD or from the VMware with Backtrack3/4. The setup includes 2 USB drives. My first USB thumb drive is 8GB and the content are boot and BT4 folder which I extract and copied from the original bt4.iso. The other thumb drive is my 2GB USB which where the Backtrack4 will be installed to.

First step, make partition?
Load your Backtrack, open the shell console and look over the connected device with fdisk.

/

Our motive is to install the Backtrack4 into 2GB USB thumb drive, which is identified as sdc. We need to make 2 partition on this 2GB thumb drive with FAT32 and EXT2 format respectively. Our FAT32 will keep the boot and BT4 folder and EXT2 is the one that will keep our changes soon.

Now, we have to delete the /dev/sdc1 partition and create a new partition for it.

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-1936, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1936, default 1936): +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 (1042-1936), default 1042):
Using default value 1042
Last cylinder, +cylinders or +size{K,M,G} (1042-1936, default 1936):
Using default value 1936
Command (m for help): w
The partition table has been altered

/

You may recheck again, with fdisk -l,

/

After the partition is created, we are going to change the linux partition to ext2.

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

Second step, copy the files?
The first partition, FAT32, will keep the boot and BT4 folder. So we have to copy those files from 8GB drive to /dev/sdc1

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/

The copy process will take some time, so be patient.

Final step, making our 2GB bootable and keep the changes?
root@bt:/# chmod +Xx /mnt/sdc1/boot/syslinux/lilo
root@bt:/# chmod +Xx /mnt/sdc1/boot/syslinux/syslinux
root@bt:/# nano /mnt/sdc1/boot/syslinux/syslinux.cfg

Now, append our changes for the EXT2 partition we created before. For example ;

LABEL BT4 Beta - Modified Version By Vpoint7@DeathOwl
KERNEL /boot/vmlinuz
APPEND vga=0x317 initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw quiet changes=/dev/sdb2

Attention to the changes=/dev/sdb2, I have chosen sdb2 because on the next boot, the 8GB thumb drive will be removed leaving our 2GB stick on and boot up. Continue on to complete the setup.

root@bt:/# ln -sf /bin/bash /bin/sh
root@bt:/# sh /mnt/sdc1/boot/bootinst.sh
root@bt:/# reboot

Lets boot from our 2GB stick, make a file on your desktop. Reboot and check it out. Its still there !!

0 comments:

Post a Comment