#!/bin/bash #Simple shell script that creates the partition for Backtrack HD Install using Parallels #Author: Budh, budh -at- nagologic -dot- com echo "Welcome, this script will set up your hard drives to install Backtrack2" echo "First we need to know what sizes you want your partitions to be" echo -n "Boot Partition size in MB ie 1GB = 1024MB (default 50): "; read BOOTP echo -n "Swap Partition size in MB ie 1GB = 1024MB (default 512)"; read SWAPP #echo -n "ROOT Partition size in MB ie 1GB = 1024MB"; read ROOTP #Warns the user that formatting procedure is taking place. clear echo "WARNING!!" echo "This procedure will wipe the content of the current hard drive." echo -n "Are you sure you want to continue. (y/n): "; read sAnswer if [ $sAnswer = "n" ] ; then echo "Leaving..." exit fi echo "Creating the partitions..." fdisk /dev/hda <<< $'n\np\n1\n\n+"$BOOTP"M\nn\np\n2\n\n+"$SWAPP"M\n\nn\np\n3\n\n\n\na\n1\nt\n2\n82\nw\nq\n' >/dev/null if [ "$?" ]; then echo "Partition creation failed on" exit else echo "Partition creation was successfull" fi fdisk /dev/hda <<< $'p\nq\n'; echo "Formating the drives..." mkfs.ext3 /dev/hda1 >/dev/null if [ "$?" ]; then echo "mkfs.ext3 failed" exit fi mkfs.ext3 /dev/hda3 >/dev/null if [ "$?" ]; then echo "mkfs.ext3 failed" exit fi mkswap /dev/hda2 swapon /dev/hda2 echo "Mounting partition..." mkdir /tmp/boot mkdir /tmp/BT2f mount /dev/hda1 /tmp/boot mount /dev/hda3 /tmp/BT2f echo "Script is completed..." exit