Add A Second Hard Drive In Ubuntu

Add Second Hard Drive in Ubuntu

Add Second Hard Drive in Ubuntu

Since I was running out of disk space, I decided that I needed to add a second hard drive to my Ubuntu server.

First thing to do is install the second hard drive into your computer. I assume you already know how to do this. One thing I have learned with IDE drives and ubuntu, always use the Ultra DMA 80 conductor IDE cables on the drives. If you don’t, you will find all kinds of disk errors in your log files.

After you have your second hard drive installed in your computer, go into your computer’s BIOS and make sure it is recognized there.

Next, boot the computer up, and see if Ubuntu can see the second hard drive. To do this, open up the terminal window and type the following: sudo fdisk -l

You should see the following:

Disk /dev/sda: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000c1e50

Device Boot Start End Blocks Id System
/dev/sda1 * 1 4905 39399381 83 Linux
/dev/sda2 4906 4998 747022+ 5 Extended
/dev/sda5 4906 4998 746991 82 Linux swap / Solaris

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd89ff2c4

Notice that the second hard drive (/dev/sdb: 500.1 GB) doesn’t show any partitions like the first drive does. (/dev/sda: 41.1 GB)

If, on the other hand, there is already data on your new hard drive,(you will see the partitions) and you want to keep the data, just skip the this part, as well as the formatting of the hard drive.

DISCLAIMER: this is what MY computer tells me for my second hard drive. You need to make sure you tell it the correct hard drive for YOUR computer as displayed in the prevous fdisk command. If you incorrectly tell fdisk the wrong drive you will destroy your data! You have been warned!

Tags: