HowTo: Backtrack 4 (Beta) Hard Drive Installation

UPDATE: See BackTrack 4 Pre-Release Hard Disk Install for updated instructions for the newer BackTrack 4 Beta.

Backtrack 4 does not contain an installer, so we wrote this step by step guide based on muts cookbook on how to install Backtrack 4 on our hard disk drive.

Step 1 – Creating the partitions
First we will need to create three partitions to be able to install backtrack on our hard disk drive. We will need boot, swap and root partitions to be created. (We can still create 2 partitions and install the boot inside the root partition)

fdisk /dev/sda

Creating the partitions

Enter ‘n‘ for new partition.
Enter ‘p‘ for primary.
Partition number ‘1‘.
Press Enter to accept default First cylinder.
Enter Size: ‘+256M

Enter ‘n‘ for new partition.
Enter ‘p‘ for primary.
Partition number ‘2‘.
Press Enter to accept default First cylinder.
Enter Size: ‘+1024M

Enter ‘n‘ for new partition.
Enter ‘p‘ for primary.
Partition number ‘3‘.
Press Enter to accept default First cylinder.
Enter Size: ‘+32G‘ NOTE: I used 32GB, you can use a size you prefer.

NOTES:
– Select ‘p’ to print the partition table and verify newly created partitions.

Type ‘w‘ to write changes and exit fdisk.

Activate Boot Partition & Specify Swap

Step 2 – Format the file systems
I formated my file system with mkreiserfs for root partition, ext2 for boot and swap for the swap partition.

mkfs.ext2 /dev/sda1

prepare swap using:

mkswap /dev/sda2
swapon /dev/sda2

mkfs.reiserfs /dev/sda3

Step 3 – Mount and Copy Directories

Now its time to copy over the backtrack files to the hard drive and configure it to run the backtrack on boot.

Mount and Copy the Directory Structure using:

mkdir /mnt/bt4
mount /dev/sda3 /mnt/bt4/
mkdir /mnt/bt4/boot
mount /dev/sda1 /mnt/bt4/boot/
cp –preserve -R /{bin,dev,home,pentest,root,usr,boot,etc,lib,opt,sbin,var} /mnt/bt4/
mkdir /mnt/bt4/{mnt,tmp,proc,sys}
chmod 1777 /mnt/bt4/tmp/
mount -t proc proc /mnt/bt4/proc/
mount -o bind /dev /mnt/bt4/dev/
chroot /mnt/bt4/ /bin/bash

NOTE: The copy operation will take some time so be patient until it finish

Step 4 – Configure Bootloader

nano /etc/lilo.conf

We will need to configure /etc/lilo.conf and define the boot and root partition so we will be able to boot into backtrack. In case we do not correctly define the root partition we will get an error “Kernel panic: no init found”.

Configure fstab

Edit /etc/fstab and append the following lines:

/dev/sda3 / reiserfs defaults 0 0 # AutoUpdate
/dev/sda2 none swap sw 0 0

Execute lilo -v

NOTE: lilo may not be installed, if not make sure you are connected to the Internet (use ifconfig to view IP address, etc., and dhclient to renew IP address if necessary). Once connected run the following to install lilo.

apt-get install lilo

You will receive the message, “LILO configuration
It seems to be your first LILO installation. It is absolutely necessary to run liloconfig(8) when you complete this process and execute /sbin/lilo after this.
LILO won’t work if you don’t do this.

So, select OK then run liloconfig, then /sbin/lilo. If you get the message, “fatal: cannot open: /etc/lilo.conf” you are basically screwed and need to search for a solution.

Execute lilo -v and reboot

Reference: http://www.offensive-security.com/documentation/bt4install.pdf

BackTrack links

Keywords:

install bt4 final to the hard disk hdd
backtrack 4 no clients
make persistent hard drive install
install backtrack 4 from usb to hard drive
bt4 manual
backtrack 4 hdd image

4 thoughts on “HowTo: Backtrack 4 (Beta) Hard Drive Installation”

Leave a Reply

Your email address will not be published. Required fields are marked *