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.

If you want to increase your current hardrive space with the hard drive that has windows xp on it, it means you want to create a raid array and for you to do that, you'd have to do it before you installed anything on both hardrive with the bios. If you want the extra space of the other hard drive, you will only have to connect it to your computer and format it. Your computer should automatically detect it and it can also be set up as dual boot if you decide not to format it
–
Tatakai WasumiJul 1 '14 at 1:46

I see I dont have enough rep to get auto approved on edits. The last line in fstab should read UUID=1579e689-3965-47db-83a7-665cceeb6aff /media/bigdata ext4 defaults
–
Captain GiraffeJul 1 '14 at 1:50

@CaptainGiraffe I think that did the job. I reboot it and I didn't have any problems like last time. I do have another quick question when I try to move files to this drive it doesn't let me. Is that because now the two drives are converted into one and when the memory in the primary drive is full the secondary drive is going to kick in. Thanks by the way how can I give you the rep points.
–
jartJul 1 '14 at 2:01

1

@jart no the free space is now only available to the directory /media/bigdata, anything in that directory will use the new drive. You might want to ask a new question on how to use that directory in the most convenient way. It would include symbolic links. If you can't put stuff in /media/bigdata you will have to look for examples of chown (change owner). It might be that the root user is the owner of that directory.
–
Captain GiraffeJul 1 '14 at 2:10

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.

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.

I did the steps from up top by the user dan08, 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.
–
jartJul 3 '14 at 15:23

You mentioned that you wanted to delete Windows XP so this example will completely delete and format the new spare hard disk (backup and save any data you do not want to delete).

Open "gparted" or run the command sudo gparted in an open terminal.

Look for the newly added storage drive, right click on it, select format to > ext4, click the icon to apply the changes and select to accept the changes before closing gparted. This will delete and reformat the drive to ext4.

Now, backup fstab with this command:

sudo cp /etc/fstab /etc/fstabcopy

Edit fstab:

sudo nano /etc/fstab

Remove or delete all the stuff YOU wrote to /etc/fstab and do NOT delete the original entries from your installation. When you are done, use CTRL + o to write the changes, press ENTER to accept the changes and use CTRL + x to exit the file.

quick question in Gparted did I have to create this new drive as a primary partition or a extended partition.
–
jartJul 3 '14 at 2:29

everything worked well but when I try to copy and paste or move a file to that folder it doesn't let me. The file that I try drag and drop reverts back as it doesn't want to be move to this location. Is as the drive is locked same goes for my original drive where I have my OS installed on. In my original drive if I try to copy and paste something into my file system drive it doesn't let me.
–
jartJul 3 '14 at 2:49

make sure you have both ownership and write permissions to do this, for example, assuming your user name is "jart", run: sudo chown -R jart:jart /media for ownership. For write permission: sudo chmod -R 755 /media You only have write permission to copy and paste into your home folder of your OS unless you are root. If you do not have write permission to your home folder anymore, run sudo chown -R jart:jart ~/ If you need to modify system files in folders such as /etc or whatever, just open thunar as sudo sudo thunar and you will have write permission over system files but be careful.
–
mchidJul 3 '14 at 17:14

when I use mkdir media/bigdata I get cannot create directory ‘media/bigdata’: No such file or directory
–
jartJun 30 '14 at 21:40

@jart that should read sudo mkdir /media/bigdata. You should set the mount point to a directory where you want this free space located. The directory needs to be empty. You might want to change the owner of that directory too, see chown.
–
Captain GiraffeJun 30 '14 at 22:59

I prefer to mount in /mnt, but many discuss which is better or more correct. sudo mkdir /mnt/bigdata AND: sudo chmod -R a+rwX /mnt/bigdata AND sudo chown -R $USER:$USER /mnt/bigdata
–
oldfredJun 30 '14 at 23:07

@CaptainGiraffe when I input the command sudo mkdir /media/bigdata I get nothing and when I try to input the command again I get this mkdir: cannot create directory ‘/media/bigdata’: File exists. please help thanks.
–
jartJul 1 '14 at 0:03

besides the mentioned, since you said xubuntu, I'm assuming you run a desktop operating system.

Uubuntu (plain) by itself for desktop tasks doesn't grow that much, and usually 10GB for / is enough for day to day usage. However, your /home/ folder might start getting bigger in time, if you go online, save data, modify data, run programs, etc..

If you are like me, and save documents in you /home//Documents-music-etc.. then a good idea would be to move the /home folder to a bigger partition/hard drive.

In linux you can literally mount chuncks of the system on different devices and it will work.

Thus in recovery mode you could do the following:

install rsync and format the new hard drive as an ext4 chunk.

mount it in a temporary location and rsync the data from the old to the new one.

so this is how my entry would like? UUD=1579e689-3965-47db-83a7-665cceeb6aff /home defaults 0 2 what is the type part for <type>
–
jartJul 3 '14 at 3:30

they type you format it as.. For me I have / on reiserfs .. don't ask.. and /home on btrfs with builtin raid1. I merely suggested another option available, if you don't want to work on the disk level, you can split in the folder hierarchy. And as stated it's up to you to decide how you want to use it, based on your needs.
–
user283885Jul 4 '14 at 18:41

Though the above will work, I'd do this as I am lazy (slash then rebuild).

Use Gparted to view the drive through the GUI. find and clean/delete the drive partitions, add a new primary partition. this will effectively reset the permissions on the drive partitions as they will be destroyed too.

sudo apt-get install gparted

also when on the root of the partition you cannot copy files to, you can do a chmod:

sudo chmod -R 777 /whereeveryourdrivenameis

you can check gparted for the location of the drive you'll like to process.

Open a root session of nautilus or your file manager, go to the drive after using gparted to wipe it, right click in the root of the drive and go over to the permissions tab. Go to advances or your manager's equivalent and set the group to "users" and owner to your user name, make permissions for the owner and group (if you like) full access with permissions to both create and delete folders and files.