Categories
BackTrack BackTrack 4 Beta BT BT4 HD HDD Linux Ubuntu VMWare WEP Windows WPA

BackTrack 4 PreRelease Hard Disk Install

Since BackTrack 4 Pre-Release does not contain an installer you can follow these steps to install BT4 quickly and easily. The assumption is that you are installing BT4 on an empty disk (/dev/sda in this tutorial).

Boot to BT4 DVD (download BackTrack 4 ISO – make sure to get the BT 4 Beta and not the BT4 Pre Release). Enter commands in bold.

1. Start by creating 3 partitions on the disk, one each for boot, swap and root. Note, since your disk size is probably different than mine the number of cylinders will likely be different.

root@bt:~# fdisk /dev/sda

The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

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

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

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (150-19457, default 150): <enter>
Using default value 150
Last cylinder, +cylinders or +size{K,M,G} (150-19457, default 19457): +16000M

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap / Solaris)

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

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
root@bt:~#

2. Format the file systems, mount them and copy over the directory structure. Chroot into new environment.

root@bt:~# mke2fs /dev/sda1
root@bt:~# mkswap /dev/sda2
root@bt:~# swapon /dev/sda2
root@bt:~# mkreiserfs /dev/sda3
root@bt:~# mkdir /mnt/bt
root@bt:~# mount /dev/sda3 /mnt/bt/
root@bt:~# mkdir /mnt/bt/boot
root@bt:~# mount /dev/sda1 /mnt/bt/boot
root@bt:~# cp –preserve -R /{bin,dev,home,pentest,root,usr,boot,etc,lib,opt,sbin,var} /mnt/bt/
root@bt:~# mkdir /mnt/bt/{mnt,tmp,proc,sys}
root@bt:~# chmod 1777 /mnt/bt/tmp/
root@bt:~# mount -t proc proc /mnt/bt/proc
root@bt:~# mount -o bind /dev /mnt/bt/dev/
root@bt:~# chroot /mnt/bt/ /bin/bash

3. Configure /etc/lilo.conf to reflect your setup.

lba32
boot=/dev/sda
root=/dev/sda3

# bitmap=/boot/sarge.bmp
# bmp-colors=1,,0,2,,0
# bmp-table=120p,173p,1,15,17
# bmp-timer=254p,432p,1,0,0
# install=bmp

# delay=20

prompt
timeout=50

# map=/boot/map

vga=0x317

image=/boot/vmlinuz
label=”BT4″
read-only
initrd=/boot/splash.initrd
append=quiet

4. Fix first line in /etc/fstab, and remove unnecessary mount lines. Add the swap partition to the fstab so it gets loaded at boot time. Your fstab should look similar to this:

/dev/sda3 / reiserfs defaults 0 0 # AutoUpdate
/dev/sda2 none swap sw 0 0
proc /proc proc defaults 0 0 # AutoUpdate
sysfs /sys sysfs defaults 0 0 # AutoUpdate
devpts /dev/pts devpts gid=5,mode=620 0 0 # AutoUpdate
tmpfs /dev/shm tmpfs defaults 0 0 # AutoUpdate

5. Execute lilo and reboot!

root@bt:/# lilo -v
LILO version 22.8, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2006 John Coffman
Released 19-Feb-2007, and compiled at 14:08:06 on May 15 2008
Ubuntu

Reading boot sector from /dev/sda
Using MENU secondary loader
Calling map_insert_data

Boot image: /boot/vmlinuz
Mapping RAM disk /boot/splash.initrd
Added BT4 *

Writing boot sector.
Backup copy of boot sector in /boot/boot.0800
root@bt:/# exit
exit
root@bt:~# reboot

BackTrack links

Categories
BackTrack BT BT4 HD HDD ISO Linux Ubuntu VMWare WEP Windows WPA

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