Steps to format/partition a hard disk drive
Step 1. If you are trying to format or partition your hard drive it is assumed that bios is able to detect the device. To determine the path and other specific information about your drive open a terminal window and enter this command:
sudo lshw -C disk
Step 2. After entering this command Ubuntu should return something similar to this. Take note of the “logical name” because this will be used throughout the partitioning process if done via terminal window.
Step 3. The part we will be most concerned with will be the hard drive information that is displayed in the terminal window.
If you plan on using the hard drive only for Ubuntu then the recommended filesystem to use is either ext3/ext4 depending on whether or not you need backwards compatibility with previous versions of Linux. If you will need to share files between Ubuntu and Windows machines fat 32 is the recommended file system to use, but NTFS will also work well also.
Step 1. First navigate to the control panel and click on the disk utility. If your disk already contains a partition and you would like to re-size it to make room for a separate partition see below.
Step 2. In the disk utility select the drive on the left hand side that you would like to format/partition. If you are formatting be sure the drive is non mounted. You can un-mount it once you have selected it. A new window will open asking you what scheme you would like to use to format the drive.The Master Boot Record scheme will work with Ubuntu and Windows operating systems. It will also work with Macintosh operating systems however the operating system will not be able to be installed on this disk. The apple system will still be able to read the data contained on the disk.
Step 3. After your drive is formatted (or if it was already) you can select the Create a Partition button.
Step 4. After clicking Create a Partition you will see a screen similar to the one above. Here you can adjust the size of your partition as well as its type and name. You can also have Ubuntu take ownership of the filesystem. This prevents you from loading a different OS on it. Also you may be unable to read the drive from certain OS.
Finish. That’s it. Your drive is now formatted/partitioned. Repeat as needed.
You can change the type of partition that will be created based on your own needs. This website will provide you with all the information you will need to decide which partition scheme to use, as well as the partition type most appropriate for your needs.
The program you will use to do this is fdisk. You will need to refer back to the logical name of your drive found earlier to use this method.
Step 1. Start fdisk with this command
Step 2. Press “m” then hit enter. This will return a menu like the one below showing all of the available commands for the fdisk program.
Step 3. Since we want to add a new partition press “n” and then enter.
Step 4. To create a primary partition (what we want) press “p” and then hit enter.
Step 5. If you only want 1 partition press “1″ and hit enter. You may be provided with a default response, you may choose this as the Partition number if you would like. Next you will be prompted for the locations of where you would like the first and last sectors of the partition to be. You may again be provided with default responses, choose these if you want.
Step 6. Now choose w to write the partition to the disk. Type “w” then press enter.Your drive is now partitioned. Now we need to format it. By default Linux will recognize this partition as dev/sdb1.
Step 7. To format the partition with an ext3 filesystem. . .
sudo mkfs -t ext3 /dev/sdb1
To format fat32 replace the “ext3″ with “fat32″