Install and format hard drive

From FreekiWiki
Jump to navigation Jump to search
How to install, and format a hard drive in Ubuntu (10.04 Lucid Lynx)

These instructions are intended to show someone how to install a hard drive and then put a file system on it using the Ubuntu Disk Utility. They were written using the latest long term support release (currently 10.04 Lucid Lynx).

Installing a primary drive into a system

A machine where there is no hard drive installed and you will be preparing this hard drive for installation.

If you do not already have a hard drive installed on your computer, you'll want to be sure of what kind of hard drive you can install. There are two main types of hard drives, IDE and SATA. Some computers will support both, and some will support only one type. If you are not sure how to determine this, you'll want to go to Section 1.1. If you know you can install an IDE hard drive go to Section 1.1. If you know you want to install a SATA drive go to Section 1.3.

Determining whether you can install an IDE or SATA drive when there is no hard drive installed.

IDE motherboard connectors
SATA motherboard connectors

The easiest way to find this information out is to open up the computer and take a look at the motherboard. You'll want to look for the IDE connectors, which are usually blue or black (but can be any color) and are two rows of 20 pins.

Even if you do find these, you'll want to double check and see if you can find any SATA connectors as well, some motherboards have both! SATA connectors are l shaped flat connectors. They are usually black or red (but can be any color).

If you have both IDE and SATA it's up to you which type you install. SATA drives are newer than IDE, and generally have a large amount of storage space. They're also a bit more efficent than IDE, and easier to set up. That being said, if you don't need too much space, it's possible to find IDE drives for relatively cheap.

Next you'll want to make sure you're ready to install a drive into the computer. You need to have a place to put the drive, and a way to secure it inside the machine. Your computer should have a metal cage in which the hard drive can be installed. It's in a different spot on each machine, so if you're having troubles finding it the best thing to do is go to the manufacturer's web page, and try to find a manual for the computer.

Once you know where the hard drive goes, you'll need to figure out how you can place it in the cage securely. It's very important that the drive doesn't just sit freely within the cage, because shocks to the drive from being knocked around can damage it irreparably. Some computers use rails to secure the hard drive in place which vary from machine to machine. Others use screws. If you can't figure out how to secure the drive in place, it's best to look at the manufacturer's web page for more information. Or try searching online.

If you want to install an IDE drive read Section 1.2

If you want to install a SATA drive read Section 1.3

Installing an IDE drive when there is no other drive installed.

Example jumper diagram
A typical IDE cable

Before you physically install an IDE hard drive you'll want to make sure that it is jumpered correctly. What you want to determine is if the hard drive is set as a master or slave drive. Look at the drive itself, either on the top, or the side above where the pin connectors are. There should be a diagram which will tell you how to set the jumper (a little plastic piece which connects two pins) to set the drive as master, slave, or cable select. Usually these options are abbreviated as follows: master - MS, slave - SL, cable select - CS.

Since this is the first and primary drive you'll want to set it as master. The cable select option means the ribbon cable attaching the drive to the motherboard will detect whether the drive is master or slave. Unfortunately you must have a special type of cable to take advantage of this option, so unless you are sure you have that type it is best to stick with using the master setting. You can easily move the jumper to the proper setting using a pair of needle nose pliers.

Now that you've done all that, you can put the hard drive in place. Once it's secure you'll want to attach the ribbon cable. If the ribbon cable has a total of three connections you'll want to make sure you pick the topmost one. Most will be marked with a 1 and then a 2 near each connection so that you know which is which, but it should be fairly apparent. When attaching the cable to the motherboard you'll want to verify which IDE port you are using. On the motherboard each port should be labeled as IDE 0 or 1. This information can be useful if you need to change the settings in the BIOS. Finally, you'll want to attach the power connections to each drive from the power supply.

Now you're ready to turn on the computer and get started setting up the hard drive for use! For instructions in how to use the Ubuntu disk utility to set up and partition the drive, go to Section 5.

Installing a SATA drive when there is no other drive installed.

SATA drives are fairly easy to connect. Once the drive is securely locked in place, all you'll need to do is connect it to the motherboard and the power supply. You should have at least two SATA connectors on your motherboard each of which will be numbered. It doesn't really matter which one you plug the drive into, but you will want to make note of the number because it will help you if you need to make changes to the BIOS settings. Second you'll need to connect the drive to your power supply. You should have a flat black female version of the connector on the drive available on your power supply. However if you don't there are converters from molex to SATA. Some SATA hard drives have connections for molex power as well, and it's okay to use those.

Now you're ready to turn on the computer and get started setting up the hard drive for use! For instructions in how to use the Ubuntu disk utility to set up and partition the drive, go to Section 5.

Installing a secondary drive for storage purposes.

If you want to add another internal drive for storage purposes, you will first need to determine what type of drive you can install in your computer (if any). This depends on a number of factors, the first being space. If you have a particularly small computer, there may not be room for another hard drive, and you will probably need to get an external hard drive. Look where your first hard drive is installed, is there a space above it or below it for another drive? Most computers will have a metal enclosure which holds the hard drive in place. If there is space for another hard drive it may be as simple as screwing a second one in on top or below the existing one. Certain systems require the use of hard drive rails which attach to the drive and support it within the enclosure. These differ for each computer, but you can use the ones which are already installed to find another pair. You can buy them online, and the Free Geek Thrift Store sells some of these, for a minimal price.

A typical hard drive
IDE Hard Drive
SATA Hard drive

There are two main types of hard drives, IDE and SATA. If you are working with an IDE hard drive, go to Section 2.1, if you are working with SATA go to section 2.2. If you don't know what type of hard drive you have, or how to find that out, read on.

The easiest way to find out what kind of hard drive you have is to open your computer and look inside. Determining whether you have an IDE or SATA drive is fairly simple. IDE drives have two rows of 20 pins. SATA drives have two thin black connectors.

If you have an IDE drive, go to section 2.1, if you have SATA go to section 2.2.

Installing a secondary IDE drive.

So you've got your hard drive, and your rails (where necessary) and you're ready to screw it in? Slow down there cowboy, there's one last thing you'll want to check before locking the hard drive into place. What you want to determine is if the hard drive is set as a master or slave drive. Look at the drive itself, either on the top, or the side above where the pin connectors are. There should be a diagram which will tell you how to set the jumper (a little plastic piece which connects two pins) to set the drive as master, slave, or cable select. Usually these options are abbreviated as follows: master - MS, slave - SL, cable select - CS. The drive which was already installed should be set to master, but you may want to double check to be sure.

The secondary drive which you are now installing should be set to slave. The cable select option means the ribbon cable attaching the drive to the motherboard will detect whether the drive is master or slave. Unfortunately you must have a special type of cable to take advantage of this option, so unless you are sure you have that type it is best to stick with using the slave setting. You can easily move the jumper to the proper setting using your fingers or a pair of needle nose pliers.

Now that you've done all that, you can put the hard drive in place. Once it's secure you'll want to attach the ribbon cable to first the master drive, and then the slave. Most ribbon cables will be marked with a 1 and then a 2 near each connection so that you know which is which, but it should be fairly apparent. When attaching the cable to the motherboard you'll want to verify which IDE port you are using. On the motherboard each port should be labeled as IDE 0 or 1. This information can be useful if you need to change the settings in the BIOS. Finally, you'll want to attach the power connections to each drive from the power supply.

Now you're ready to turn on the computer and get started setting up the hard drive for use! For instructions in how to use the Ubuntu disk utility to set up and partition the drive, read Section 5.

Installing a secondary SATA drive.

SATA drives are fairly easy to connect. Once the drive is securely locked in place, all you'll need to do is connect it to the motherboard and the power supply. You should have at least two SATA connectors on your motherboard each of which will be numbered. The one labeled SATA 0 is most likely already occupied by the hard drive which was already installed. It doesn't really matter which one you plug the drive into, but you will want to make note of the number because it will help you if you need to make changes to the BIOS settings. Second you'll need to connect the drive to your power supply. You should have a flat black female version of the connector on the drive available on your power supply. However if you don't there are converters from molex to SATA. Some SATA hard drives have connections for molex power as well, and it's okay to use those.

Now you're ready to turn on the computer and get started setting up the hard drive for use! For instructions in how to use the Ubuntu disk utility to set up and partition the drive, go to Section 5.

A note about BIOS settings.

The BIOS settings give you the ability to change how the motherboard deals with each drive. For example you can enable or disable certain ports, or you can make it so that the computer will always boot from the hard drive first, and then the optical (DVD) drive(s). How you get into the BIOS and the setup is going to vary from computer to computer, but you should see instructions as soon as you turn on the computer. In general you will see a screen which will flash something like "F2 for BIOS" or "F10 for Setup". As soon as this flashes you'll want to hit the key it indicates. The most common ones are Delete, F2 or F10. If you can't figure it out, try checking the manufacturer's website.

Once you get into the BIOS you'll be able to change settings easily, but how you change them and where they are located is different for each BIOS. It's usually best to spend some time looking through all of the menu options. Each BIOS will tell you how to change things or when menus are expandable.

Section 4. External Hard Drives

External hard drives are very handy. They can be a safe way to back up your information and make for easy transfer of large files between computers. It is possible to buy one new with the hard drive installed and ready to use. All they are is an enclosure which houses the drive. This enclosure contains a small circuit board which enables the drive to communicate with a computer. It also powers the drive.

It is possible to buy the enclosure without a drive, so that you can install one yourself. It's also possible to remove the drive from one where it is already installed and swap it out for another. If you install a drive which already has information on it, you should be able to start using it right away. If the drive does not have anything on it, and isn't formatted, you'll need to put some kind of file system on there first so that the computer can work with it. What kind of file system you put on there depends on what types of computers you will be using it with. How you put a file system on there depends on what operating system you are running. Section 5 of this guide walks you through how to put a file system on a drive using the Ubuntu Linux operating system.

Section 5. Formatting a drive

There are many different methods for formatting a hard drive, and they all relate back to how the hard drive will be used. If the hard drive is going to be the primary drive and will have an operating system (OS) like Ubuntu installed, it is not necessary for you to format the drive before the install. The OS will format the drive while installing. However if you want to load multiple OS's onto a drive, you will want to do some formatting beforehand.

For instructions on how to set up a drive to dual boot Ubuntu and Windows go the Ubuntu website has an extensive walk-through. It really can't be improved upon, so go there and follow the instructions. Here's the link: https://help.ubuntu.com/community/WindowsDualBoot. For how to set up a drive to dual boot Ubunut and a Mac OS there's also some good instructions on the Ubuntu website here: https://help.ubuntu.com/community/MactelSupportTeam/AppleIntelInstallation#Dual-Boot: Mac OSX and Ubuntu

If you want to use the drive as back up or storage you'll want to choose a file system appropriate for this. The type of file system you'll need to use depends on whether you are going to be using the drive with multiple operating systems or not. There are quite a few different types of file systems out there, and while some OS's will read multiple file systems, not all are cross-compatible. NTFS is a file system which is recognized both by the Ubuntu Linux OS and Windows. FAT32 is recognized by Ubuntu, Windows and the Mac OS. However it is important to note that when using FAT32 you cannot have any one file greater than 4GB.

When using Ubuntu to format a drive, all you have to do is go to the disk utility and select the drive. The disk utility can be found under System -> Administration (Ubuntu 10.04). Once there you should see an entry for each of the drives installed or attached to your computer. If the new drive is external, it will be under the Peripheral Devices menu.

When you click on the drive it should bring up information about that drive on the right hand side. It will tell you useful things (if you didn't already know them) such as the size of the drive and whether it already has a partition on it. You will need to put some kind of partition on the drive before you put a file system on there. At the middle left hand of the screen under the drive information is a spot where you can click to put a partition on the drive.

Here disk utility gives you a few options for what type of partition to choose. The most commonly used by devices in the last 8 years or so is GUID. Older legacy devices may need you to have a Master Boot Record partition on there. If you are not sure the best way to find out is to search the operating system you are using + GUID. Once you've selected your partition hit 'Format.'

It'll ask you if you're sure and you'll need to hit 'Format' again. This should only take a second or two. Once it's finished you'll see that under the drive information 'No Partition' has changed to 'GUID Partition Table' or whatever option you chose.

Now at the bottom left hand corner you'll see a green plus sign and the option to 'Create a New Partition.'

This will bring up a menu asking what type of partition you want. You can choose whichever you wish for what types of computers the drive will be used with. Note that if you are going with the FAT32 type file system Disk Utility refers to it simply as FAT. You can also choose how much space on the disk you want to partition, giving you the option to different portions of the drive different file systems. Give the volume a name and click 'Create.'

This will also only take a few seconds (as long as the drive is empty), and once it's finished you'll see that the drive is named, has a file system, and that there are options that weren't there before like 'Mount Volume' and 'Check Filesystem.'

At this point you're ready to use the drive! If you want to use it right away choose 'Mount Volume' and you'll be able to see the drive in order to add files to it. When you're finished you can unmount it either from disk utility or the folder view on your system. From here either right click the drive and choose 'Safely Remove Drive' or hit the eject button on the left hand side under places. You may now unplug and turn off the external hard drive.