. home . news . hacks . fnord . images . allies . santa .

bt4 beta persistent on usb

preperation

get a laptop, a usb thumb drive with a minimum size of 2GB (& internet) (tip: you might already have a computer and internet, when you can read this text)

then

mplayer http://santa.fnord.cx/mu51c/the_prodigy_-_invaders_must_die.mp3 && exit

now open a second terminal and download the backtrack 4 beta iso, or wget it

 cd /tmp && wget http://remote-exploit.org/cgi-bin/fileget?version=bt4-beta-iso

or if the first one does not work, try this one

cd /tmp && wget http://backtrack.unixheads.org/bt4-beta.iso

(if both of them won't start downloading, don't worry and just start “wget” again some seconds later and it should work, or try the unl33t link)


meanwhile we could start cleaning and formatting our usb drive

cleaning the usb

remember theat you have to be root to perform the most steps in this howto.

insert the usb drive, then type

cat /proc/partitions

to find your usb drive, which should output something like

 8       16    2015232 sdb
 8       17    2013729 sdb1

to cleanup the stick, and overwrite the data with a random pattern you can make

dd if=/dev/urandom of=/dev/sdb

if you want to check for bad blocks while writing you can use badblocks. the badblocks command will check your disk for bad blocks while writing random data. the pseudorandom algorithm used by this command is faster (although “less random”) than /dev/urandom, so it can be useful for large disks.

 badblocks -s -w -t random -v /dev/sdb

cleanup partitiontable

now you can use fdisk to clean up your partition table

fdisk /dev/sdb
Command (m for help): p

Disk /dev/sdb: 2063 MB, 2063597568 bytes
64 heads, 62 sectors/track, 1015 cylinders
Units = cylinders of 3968 * 512 = 2031616 bytes
Disk identifier: 0xb8b945f9

Device Boot      Start         End      Blocks   Id  System

if you have any partitions in here, delete them, using “d”, until it looks like the output above, and you have no more partitions on your usb.
! but be careful, you only delete partitions of your stick, not of your system !

Command (m for help): d
Partition number (1-4):

your disk should be clean now, and you can start creating your new partitions …

create partitions

you can start creating your new partitions, by typing “n”
the first partition will be vfat and contain our bt4

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1015, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1015, default 1015): +1024M

the second partition will be ext2. this is where our changes are going to be stored.

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (531-1015, default 531):
Using default value 531
Last cylinder, +cylinders or +size{K,M,G} (531-1015, default 1015):
Using default value 1015 

now it is time to make your fat32 partition “t”

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)

toggle the bootflag with “a”

Command (m for help): a
Partition number (1-4): 1

and a final look to the tables “p”

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         594     1178465    b  W95 FAT32
/dev/sdb2             595        1015      835264   83  Linux

everything looks good so lets write these changes to the drive. type “w” and enter

make filesystem

for the first partition

mkfs -t vfat -n BT4 /dev/sdb1

and for the second partition

mkfs -t ext3 -b 4096 -L casper /dev/sdb2

installation

create a directory

mkdir -v /tmp/bt4

and mount the iso to it

mount -v -o loop /tmp/bt4-beta.iso /tmp/bt4

create another directory

mkdir /tmp/usb

and mount the first volume to it

mount -v /dev/sdb1 /tmp/usb/

and copy the files

cp -rfv /tmp/bt4/* /tmp/usb

or

dd if=/dev/loop0 of=/dev/sdb1

meanwhile you can open a new terminal and …

mplayer http://santa.fnord.cx/mu51c/the_prodigy_-_thunder.mp3 && exit

when your done with copying files, make it bootable

/tmp/usb/boot/bootinst.sh

make changes become persistent

make a third directory

mkdir -v /tmp/changes

mount the second partition of your usb to it

mount -v /dev/sdb2 /tmp/changes

and create the changes directory

mkdir -v /tmp/changes/changes

cd into syslinux

cd /tmp/usb/boot/syslinux

and change some rights

chmod +Xx lilo -v
chmod +Xx syslinux -v

or more brutal

chmod 777 lilo -v
chmod 777 syslinux -v

and finally

vim syslinux.cfg

and paste all of the following to line 5, after “DEFAULT”

LABEL BT4
MENU LABEL BT4 Beta - DARE changes
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw quiet changes=/dev/sdb2 vga=0x317

when you are finished press escape

esc

type

:wq

and hit enter to write the changes to file.

cleanup

unmount the volumes

umount -v /tmp/changes
umount -v /tmp/bt4

and delete the evidence ;)

rm -rfv /tmp/changes
rm -rfv /tmp/bt4
rm -fv /tmp/bt4-beta.iso

and finally

reboot
 
home/bt4b_change5.txt · Last modified: 2009/08/06 13:33 (external edit)