LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   No access rights to delete or move files after re-install and moving from user folder (https://www.linuxquestions.org/questions/ubuntu-63/no-access-rights-to-delete-or-move-files-after-re-install-and-moving-from-user-folder-782574/)

sonicboy 01-16-2010 07:33 AM

No access rights to delete or move files after re-install and moving from user folder
 
First of all, sorry for the long title but didn't know how to describe it in another way:-)

So, here is my problem: I've reinstalled my kubuntu 9.10 on my laptop and tried to re-use the user folder from my previous installation. But this didn't succeed as he could not open the home folder (probably due to updates or something). So, I've made a new user folder and moved all my personal files via using 'sudo konqueror' in a terminal.
But when I try to move, delete, ... a file via dolphin, the delete option is grayed out or in it tells me that I don't have access rights.

When looking to the properties of a file, I see that it is indeed created by another user (mostly it says user 500, whilst I've never used that name, in other cases it is my other login name)so that could be the explanation that I cannot manipulate the files.

I know i could with using a terminal or such, but I'm just an ordinary user who prefers an ui.
So, is there a possibility to move the files to my new user folder without having the limitations on permission rights?

Help is much appreciated!

cu

10110111 01-16-2010 07:58 AM

Well, if you need a GUI for this... try using konqueror or whatever starting it as root, e.g. sudo konqueror. Though, i would never recommend starting GUI programs as root. Then just go to the directory where your files are located and change their owner to yourself. Better is to change owner only of the files which are owned by user 500, because there may be some files which are owned by root, but this would require some knowledge of command line.

tommcd 01-16-2010 08:48 AM

Was this your home directory? Or was it a different directory where you stored your files?
You could have just opened a terminal and used the chown command like this. First, cd into the directory where the problematic directory (or folder) is located:
Code:

cd /path/to/directory
Then run:
Code:

sudo chown -R your_user_name:users directory-name
Where directory-name is the name of the directory you want to change ownership of.
This will return ownership of the directory to your_user_name. The -R option will make chown work recursively on all sub-directories within the problematic directory.
You should not do this with system files and directories. Only use this for directories that have your personal files in them.

sonicboy 01-16-2010 01:50 PM

Hi,

It is indeed my home directory. I did the following: I copied everything to my external hd, deleted it on my other user directory and then copied it to my new user directory. May be a little odd, but it seems to do the trick:-).

Only for some files, like on my usb stick i still have no permission rigths to. I'll use your tricks to fix this

thanks for the help!

tommcd 01-17-2010 09:14 AM

Quote:

Originally Posted by sonicboy (Post 3828869)
Only for some files, like on my usb stick i still have no permission rigths to. I'll use your tricks to fix this

Is your /home directory on a separate partition from your root directory?
If so, then when you reinstalled Kubuntu, if you chose manual partitioning and selected your /home partition as /home for the reinstall, you should have had ownership of your old home directory. If you chose a different mount point for the directory though, it is possible that K/Ubuntu did not grant you ownership of that directory.

When you plug in the usb stick, does it automount and open up the contents of the usb stick automatically in a folder window? This is how it always works for me in Ubuntu.
If you don't have write access to the usb stick then you can just chown the mount point for it you should be good. For example:
Code:

sudo chown -R your_username:users /media/disk
or wherever Kubuntu decides to mount it. It is always /media/disk for me.
I don't know why you don't get write access to the usb stick though.
Remeber, only use chown and chmod on directories that have your personal data on them. Don't use them on system files and directories, unless you have a very good reason for doing so. Altering permissions of system files can lead to problems and security risks.

sonicboy 01-18-2010 04:28 AM

Quote:

Is your /home directory on a separate partition from your root directory?
If so, then when you reinstalled Kubuntu, if you chose manual partitioning and selected your /home partition as /home for the reinstall, you should have had ownership of your old home directory. If you chose a different mount point for the directory though, it is possible that K/Ubuntu did not grant you ownership of that directory.
Yes, my home directory is on a separate partition (i thought this always needs to be a separate partition?) and I selected the mount point manually. But when i re-installed kubuntu, it couldn't boot from this home directory (don't know how, in the past i've also have re-installed linux and used the same home directory and it worked). So then i decided to make a new user and copy all the files to this directory, think it must have to do something with this..

About my usb, i tried to change the user manually with konqueror but didn't succeed because some error. Then I decided to do the same trick as with my home directory, namely copying everything to my hd and then copying it back. Next time I'll use your command line, didn't know how what options to use on myself :-)

thx for the help


All times are GMT -5. The time now is 06:54 PM.