Page 1 of 1

changing directory permissions

Posted: October 23rd, 2011, 4:42 pm
by mike
Hi

I've just added a new 2TB drive that I will use to store films etc. I have successfully formatted and mounted the drive as /media (the media directory now indicates that it is 1.7TB in size), however permissions are set to 'root' and I as a user cannot create new folders etc to migrate my data to.

I know that changing the permissions relates to the chmod command, but I cannot seem to be able to change the permissions. I have tried the likes of

chmod a+r+w media - failed
also tried this as sudo which seemed to execute, but didn't change the permissions

I did have a smaller drive set up correctly (i.e. could add/delete files), but changed to the larger drive and now cannot for the life of me remember how I changed the permissions. Can some kind soul point me in the right direction?

thanks in advance

Mike

Re: changing directory permissions

Posted: October 23rd, 2011, 5:14 pm
by Sergeus
I believe, and someone should fact-check me on this because I'm not very experienced with Linux file permissions, but you should be able to do this:

sudo chown -R yourusername:yourusername /media

Put in your sudo password if prompted, and then your username should be the owner and you can change everything. The -R is there in case there are already any folders/files on the drive, so it will change the permissions of those too. I hope. Ian or Andy will be able to answer this better than I can.

Re: changing directory permissions

Posted: October 23rd, 2011, 5:27 pm
by mike
thanks, worked a charm

mike

Re: changing directory permissions

Posted: October 23rd, 2011, 10:30 pm
by Ian
Sergeus wrote:I believe, and someone should fact-check me on this because I'm not very experienced with Linux file permissions, but you should be able to do this:

sudo chown -R yourusername:yourusername /media

Put in your sudo password if prompted, and then your username should be the owner and you can change everything. The -R is there in case there are already any folders/files on the drive, so it will change the permissions of those too. I hope. Ian or Andy will be able to answer this better than I can.
Nout wrong with that advice sir. Spot on! :clap: