0

I would like to mention that I am completely new to Ubuntu and Linux in general. I wanted to reinstall window 7 on my laptop but someone suggested Ubuntu since it's free, faster and safer. I let myself be convinced since the person promised me the transition will not be difficult and I have to say I'm starting to regret my decision. Everything has been a nightmare so far, and this current issue is part of the problem:

I have backed up all my files on an external hard drive. When I installed ubuntu, I created a swap partition, a root "/" one and a "/home" one which I later divided again into two smaller ones using gpartition.

Now I am trying to copy-paste the files from my external hard drive onto one of the two free partitions and the "paste" option is grayed out.

I have researched this problem, with no useful result. When accessing the properties of the external hard drive, nothing is written in the "filesystem type" category. The partition/device I am trying to copy my files into has a filesystem type ext3/ext4, and in the permissions category, it says that the owner is "root" and everything else related to access is grayed out.

Can someone please put into simple terms what the problem is and an easy solution to fix it? I'm no expert, I've barely used the terminal and I want to find a way to make it so that I don't have to do 20 tasks just to copy-paste something that would have taken me just 2 steps in windows.

3
  • How did you "divide" partitions?...
    – Richard
    Dec 23, 2014 at 20:29
  • Go to your terminal and check whether you can able to access your external hard drive...If so use the copy cmd to move the files over..... "cp -R foldername destination folder"
    – BDRSuite
    Dec 23, 2014 at 22:13
  • I divided them by running the usb stick that I used to install ubuntu, but I selected the 'try ubuntu' option and used GPartition to split the big partition into 2 smaller ones. Dec 23, 2014 at 22:46

2 Answers 2

0

When you first go to terminal you are in the home directory. The partition you made would place your folder in the /media directory. I am working to reproduce the problem using Ubuntu 14.04 as my previous experience was using Ubuntu 10.04. Then I can give more detailed instructions.

OK, I have just created a new partition using GParted. I go into the file browser and right click to find it's properties. It says filesystem type ex3/ex4. The location is /media/jim, and under permissions it says that the owner is "root". When I try to paste a file into this directory the "paste" menu item is greyed out. Now I am going for the fix...

I open terminal and type:

jim@GX270-11QPFS1:~$ pwd
/home/jim

I am currently located at /home/jim but I need to be in /media/jim to make my changes.

jim@GX270-11QPFS1:~$ cd /media

Note I use / and not \ as in windows.

jim@GX270-11QPFS1:/media$ ls
floppy  floppy0  jim

The 'ls' command here shows I have three folders under /media. I need to go to the "jim" folder. I do this using:

jim@GX270-11QPFS1:/media$ cd jim

then:

jim@GX270-11QPFS1:/media/jim$ ls
3AF0C082F0C045BB  D4E7-CABA  TempPart

The 'ls' command shows that I have three directories. One of the directory names is TempPart. This is the label I assigned to my partition. Now I check the ownership with the ls -l command:

jim@GX270-11QPFS1:/media/jim$ ls -l
total 25
drwx------  1 jim  jim  20480 Dec 22 23:20 3AF0C082F0C045BB
drwx------ 12 jim  jim   4096 Dec 31  1969 D4E7-CABA
drwxr-xr-x  3 root root  1024 Dec 23 15:32 TempPart

As you can see my folder has owner and group of "root". Now, finally, I apply the chown command:

jim@GX270-11QPFS1:/media/jim$ sudo chown jim:jim TempPart
[sudo] password for jim: 

Using ls -l to check:

jim@GX270-11QPFS1:/media/jim$ ls -l
total 25
drwx------  1 jim jim 20480 Dec 22 23:20 3AF0C082F0C045BB
drwx------ 12 jim jim  4096 Dec 31  1969 D4E7-CABA
drwxr-xr-x  3 jim jim  1024 Dec 23 15:32 TempPart

And no I can copy and paste into the folder. By the way, Root_Temp and TempPart are just arbitrary names that I made up for the sake of illustration. You need to know the label you gave your partitions when you created them. Also anywhere my instructions say 'jim' you would put your username such as christina.

So, in summary, do the following:

  1. Go to file finder or whatever program you are using to copy and find the name of the directory you are trying to copy to.

  2. Right click (or whatever you did before) to find the attributes for the folder. Note it's location. In my case it was /media/jim. For you it may be /media/cristina.

  3. Open terminal and cd to /media/cristina or whatever path you found the folder to be located in.

  4. Once you are there do a ls -l to confirm your folder is there and it's ownership.

  5. Run the chown command as $sudo chown cristina:cristina foldername

  6. Run ls -l again to confirm that ownership properties have changed.

3
  • I followed the instructions, but things are not working when I do the ls command: cristina@cristina-Studio-1558:/media/cristina$ ls 8bcf8352-659f-489f-bc62-40e2e4e4a986 cristina@cristina-Studio-1558:/media/cristina$ ls - l ls: cannot access -: No such file or directory ls: cannot access l: No such file or directory cristina@cristina-Studio-1558:/media/cristina$ any ideas? and thanks for going through all this, but apparently the solution is not obvious or easy (as always, just my luck) Dec 24, 2014 at 0:12
  • Don't put a space after the '-'. You put ls - l It should be ls -l
    – JamesH
    Dec 24, 2014 at 0:23
  • Did you find the location of your partition? Because I don't think that 8bcf8352-659f-489f-bc62-40e2e4e4a986 is your partition name. It looks like the name of your root partition. You don't want to change it's ownership or use that directory for storage. Anyhow, if you are convinced you have the actual partition you created I was glad to have helped- good luck!
    – JamesH
    Dec 24, 2014 at 0:38
0

The problem is that you cannot paste into a directory where the owner is root unless you do so with root privileges. To fix this go into terminal and find your directory using something like:

$ ls -l | grep "^d"

In my case I created a subdirectory called Root_Temp and changed its ownership to root. Here is the output (partial) from the command above:

drwxr-xr-x  2 jim  jim     4096 2010-08-30 21:52 Public
drwxr-xr-x  5 jim  jim     4096 2014-12-21 17:25 Purchase
drwxr-xr-x  2 root jim     4096 2014-12-23 14:04 Root_Temp
drwxr-xr-x  2 jim  jim     4096 2011-01-04 22:29 _sheet_music
drwxr-xr-x  2 jim  jim     4096 2010-11-11 20:54 spanish

Note that the Root_Temp entry has owner of "root" and group of "jim". I did this using the command:

$ sudo chown root:jim Root_Temp

To change it back I simply issue the command:

$ sudo chown jim:jim Root_Temp

Which gives the following result:

$ ls -l | grep "^d"
drwxr-xr-x  5 jim jim     4096 2014-12-21 17:25 Purchase
drwxr-xr-x  2 jim jim     4096 2014-12-23 14:04 Root_Temp
drwxr-xr-x  2 jim jim     4096 2011-01-04 22:29 _sheet_music
drwxr-xr-x  2 jim jim     4096 2010-11-11 20:54 spanish

Now my Root_Temp directory has owner as "jim" and I can now write to this directory.

1
  • the results I got after running the first command are these: drwxr-xr-x 2 cristina cristina 4096 dec 23 23:16 Desktop drwxr-xr-x 2 cristina cristina 4096 dec 23 19:56 Documents drwxr-xr-x 2 cristina cristina 4096 dec 23 22:00 Downloads drwxr-xr-x 2 cristina cristina 4096 dec 23 19:56 Music drwxr-xr-x 2 cristina cristina 4096 dec 23 19:56 Pictures drwxr-xr-x 2 cristina cristina 4096 dec 23 19:56 Public drwxr-xr-x 2 cristina cristina 4096 dec 23 19:56 Templates drwxr-xr-x 2 cristina cristina 4096 dec 23 19:56 Videos there is no Root_Temp among them, so I don't know how to use your instructions Dec 23, 2014 at 22:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .