I am going to put an additional (non-USB) hard drive in my system. I already have Ubuntu on my other hard drive so I do not want to install Ubuntu on the additional drive but only use it for storage. How do I add the additional hard drive to my Ubuntu system, e.g. make Ubuntu recognize it and mount it properly?
Your hard disk might have no partitions yet.Therefore it's not usable until you make a partition.
You can install the software gParted from Ubuntu software center, and make a new partition in your new hard disk.
Open gParted and select the correct drive from top right drop down list:
Choose Device menu > Create Partition Table
Create a new msdos partition table.
Now add a new partition to the table by right clicking on unallocated space.
Setup your partition:
(TIP: Ext4 file system is efficient. NTFS file system is supported by Microsoft Windows)
Once done click on the right button:
Its is better to reboot your computer. Then your new hard disk will be available to use.
Step 1) Connect the drive. Wipe the drive if desired.
a) If you have data on the drive that you need to keep, back it up. b) Fill the drive with zeros which will blow away the MBR and all data by:
sudo dd if=/dev/zero of=/dev/sdX
**or** if you want a progress report as you wipe the drive use
sudo dc3dd wipe=/dev/sdX in both cases sdX should be changed to sda, sdb, or whatever drive you are wiping.
If you are not certain, you can identify the drives using
source: Remove lvm to install Ubuntu
Step 2) Partition the drive. I use gparted.
a) open gparted - your password will be required
b) select the drive you are working with in the box on the upper right
You will see similar to this:
c) create a new partition table. I won't be discussing partition table types here as that's beyond the scope of this answer.
From the menu choose device and then create partition table.
Click apply - Gparted will apply the change and rescan the disks
d) format with a filesystem of your choice. I will use ext2 in this example. choose the filesystem that you prefer. ext4 is my preferred filesystem.
Right click on the unallocated line and select new, adjust settings if necessary here then click add.
Step 3) Format the drive (put a file system on it) I used ext2 (the default)
Click the green check mark to apply the format. You will be warned. Click apply
When the process is complete you'll get the below. you can expand details as needed then click close.
source: experience - full manual is here: http://gparted.org/display-doc.php?name=help-manual
Step 4) Mount the drive: Where you mount it is where the space will be. I will mount to the empty directory at /srv using old-school methods. You can use blkid as covered elsewhere on the site if you so choose.
In the image below you can see that I ran
fdisk -l to insure I had the right drive designation prior to running the mount command `sudo mount /dev/sdc1 /srv
Step 5) Set permissions at the mount point properly so that the appropriate users/groups can use the drive - currently only the owner root has full access.
sudo chmod -R 777 /srv will give full read/write/execute access to the drive for everyone. Restrict as you see fit. for more information on permissions see the chmod man page.
You can also change ownership on the drive with chown if desired. See the man page for chown by running
man chown in a terminal. If you wish to have the drive mounted every time you boot, you'll need to edit fstab (some would call this a permanent mounting). Editing fstab has been covered in great detail both here and elsewhere on the site. for an example issue the command
cat /etc/fstab which will show you the current list of drives and with what options they are mounted at boot.
cat /etc/mtab will show you all current mounts.