Change permision from root to user

I recently got a new external drive and backed all my files up on the new external: movies, music, docs, etc. Now all my files have permission rights to the root only.

I was able to change this by open up nautilis from a terminal in root and change the permission on the whole drive to my current user so I can access the files, copy & delete the files.

I wanted to change some music file information in Kynamo this morning and was not able to since all the individual files still belong to the root. How can I change this permission issue without having to change each individual file?

What format is the drive? ext4, ntfs??

What connection is the drive? USB?

My external USB is ext4 and mounts automatically by Label under /media
No problems

Filesystem is type ext3/ext4. Drive is usb connection.

Everything mounts fine and I have access to all my information, I only have the issue of not being able to change any information (music tags) unless I’m in root. I’m just wondering if there is a faster way to change the permission of the files without having to change each individual file music file.

I’m not sure how to explain this any better.

On 06/06/2010 10:16 AM, the Dude abides wrote:
>
> Filesystem is type ext3/ext4. Drive is usb connection.
>
> Everything mounts fine and I have access to all my information, I only
> have the issue of not being able to change any information (music tags)
> unless I’m in root. I’m just wondering if there is a faster way to
> change the permission of the files without having to change each
> individual file music file.
>
> I’m not sure how to explain this any better.

When you copied the information, you likely created the files as root.
To change the ownership of all the files in a certain directory, you should

sudo chown -R <newuser>:users <directory>

Substitute your user name and the directory in question for the items
inside <>.

the Dude abides wrote:
> I only have the issue of not being able to change any information
> (music tags) unless I’m in root.

in you first post you wrote “and backed all my files up on the
new external” and i wonder how you did that:

  • who owned the UBS drive when you did that (did you own it, or root)

  • i believe, if the drive was mounted giving users access, then you
    should have been able to (as yourself) copy the files over to the USB
    as yourself OR use the -p switch as root and thereby preserve their
    ownership as being yours (though you should not have had to be root to
    copy them)…

  • or, i believe you could have used rsync and done the same thing,
    with the correct switches applied…

what i am saying, you should not have to involve root at all now, but
you had to copy/rsync (or what ever you meant by “backup all my files
up”) in a way that ownership does NOT switch to root…

see:
man cp
man rsync

[and that is probably on two of many different ways to and “backed up”
the files without having your current frustration with needing root…]


DenverD (Linux Counter 282315)
CAVEAT: http://is.gd/bpoMD
posted via NNTP w/TBird 2.0.0.23 | KDE 3.5.7 | openSUSE 10.3
2.6.22.19-0.4-default SMP i686
AMD Athlon 1 GB RAM | GeForce FX 5500 | ASRock K8Upgrade-760GX |
CMedia 9761 AC’97 Audio

Sorry for not being clear enough. When I backed up my files, what I meant was I copy and pasted my movie and music files to my external drive. I didn’t use rsync

Also I ran
sudo chown -R <newuser>:users <directory>

I changed the newuser & directory to my user and the location of my external drives folder which I wanted change and got
syntax error near unexpected token `newline’

When the external mounts is it given a mount point like /media/disk1

Or does your disk have a volume Label that ensures the same mount point every time?
For example if you give a disk a volume label Eg: EXTERNAL
It will always mount /media/EXTERNAL

I can’t understand why you don’t have r/rw access as it is but you could then do

chown yourusername /media/EXTERNAL

Thank you everyone for such quick responses.I ran

chown yourusername /media/EXTERNAL (with my settings)

and the next time I opened the external drive, I was able to read & write again. Now I can finish my media editing.

Thanks.rotfl!

Next time do not copy to an external media with a non Linux filesystem. Thus you will loose all ownership and access information.

And as said above, when you copy your personal data (from /home/<yourusername>) there is no need to do this as root, thus you should not do it as root.