Ubuntu – How to add a second hard drive to an already installed Xubuntu 14.04

hard drive

I want to know how to install a second hard drive in Xubuntu 14.04. Taking in mind that I already installed Xubuntu in another hard drive. I just want to add more storage to it. Also the other hard drive has Windows XP installed in it and I just want to delete it off. I want to add all the extra storage to the existing hard drive that has Xubuntu.

# Use 'blkid' to print the universally unique identifier for a 
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5). 
# 
# <file system> <mount point>   <type>  <options>       <dump>  <pass> 
# / was on /dev/sda1 during installation  
UUID=f0212a60-ad55-43d9-9418-8b9d6bea832d /               ext4   errors=remount-ro 
# swap was on /dev/sda5 during installation  
UUID=8bdc6e45-c488-4400-9a1c-aa1dc2722a39 none            swap    sw    
UUID=1579e689-3965-47db-83a7-665cceeb6aff /media/bigdata  ext4    defaults

I followed dan08 steps, the drive is mounted in bigdata everything is fine the only thing is that I can't move anything to it like files. Is like I need a permission or something in order to paste or move a file to it. This is what I get when I try to move a file to it. Error opening file '/media/bigdata/uninstalling wine.odt'. Permission denied.

How do I use chown to change my permissions in my new drive, so I can copy and paste on it?

**When I go to the new partition drive and I open the terminal in that location and I type Ls -L this is what I get total 16 drwx—— 2 root root 16384 Jul 3 10:05 lost+found

edit:
I got it to work I just had to change the permissions with chown after mounting the hard drive.

Best Answer

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. wipe

If you are not certain, you can identify the drives using fdisk -l

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:

gparted1

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.

gparted2

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.

gparted3

Step 3) Format the drive (put a file system on it) I used ext2 (the default)

gp4

Click the green check mark to apply the format. You will be warned. Click apply

gp-process

When the process is complete you'll get the below. you can expand details as needed then click close.

gp-complete

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

mount1

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.

source: experience, man chmod

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.

Related Question