Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a number of drives internal and external. Some are partitioned. Most mount automatically at boot (all did at one point).

One partition is owned by root and therefore does not mount automatically. I know how to mount it as root.

I do not know how to take ownership of that partition as user X. I have tried changing permissions using the gui in Nautilus as root. They are not accepted and immediately revert.

The partition is NTFS. The other parition on that drive is owned by me as user and mounts automatically

share|improve this question
    
try sudo chmod a+rwx /yourpartition –  mvario May 18 '11 at 5:13
    
if they mount automatically at boot time, it means you modified your /etc/fstab, so edit your question to show the content of this file. –  enzotib May 18 '11 at 5:50

4 Answers 4

up vote 20 down vote accepted

Did you try

sudo chown user:user

For example sudo chown cyrex:cyrex (User:Group)

if the partition is called party, your user is called cyrex and it is in /media just do for example:

sudo chown cyrex:cyrex /media/cyrex/party -R (The R is for recursive so it affects all directory/files and subdirectory.

As noted, the partition is NTFS so if is automatically mounted you need to make sure that the user that has permission is you. To do this follow this steps:

  1. Go to console (gnome-terminal)
  2. Type id -u. This should give you the user id you have which you will insert into fstab.
  3. Open fstab sudo /etc/fstab and search for the line that is mounting the ntfs partition.
  4. Assuming is something like this:

UUID=1234532123 /media/amntfs ntfs defaults 0 0

Add to it the umask, uid and gid masks like this

UUID=1234532123 /media/amntfs ntfs defaults,umask=007,uid=1000,gid=1000 0 0

Save the file and just reboot or remount the unit.

The uid is your User ID. The one you got from id -u.
The gid is you Group ID. Normally the same as -id -u but you can check it with id -g.
the umask is like chown but reversed.

NOTE - Like it was mention below (Which did not read that part in the question), chown does not touch a ntfs because is not compliant POSIX

share|improve this answer
    
chown do not works on NTFS partitions. –  enzotib May 18 '11 at 5:48
1  
Lol. Did not read that small, tiny, elusive 4 letter word. Added content for NTFS permission. –  Luis Alvarado May 18 '11 at 15:30
    
It was strange that a 5k user like you do such a mistake :). Regarding id user | cut ... I suggest id -u. –  enzotib May 18 '11 at 15:35
    
Correct much better. Anybody can make a mistake so do not mind the points... am still human... for now (Evil eyes). Thanks for pointing it out. –  Luis Alvarado May 18 '11 at 15:37

All my NTFS partitions are owned by root, yet I can access them fine as user. It's a matter of mount options rather than ownership and file permissions (remember, it's a NTFS partition - you can't change any permissions there).

In my /etc/fstab the partitions are included as follows:

UUID=AB84274F84211B98   /media/WIN7     ntfs   defaults  0   0
UUID=CDBAF39E13A2AC2D   /media/DATA     ntfs   defaults  0   0
UUID=EFA980B33BA33DF5   /media/MEDIA    ntfs   defaults  0   0

where defaults are default mount options that already should do what you want to do.

To find the UUIDs, run sudo blkid.

See also: How to 'chmod' on an NTFS partition?

share|improve this answer

I was having a hard time solving the problem and this solution worked for me

  1. install physical storage device manger:sudo apt-get install pysdm
  2. open storage device manger:sudo pysdm
  3. choose your required drives
  4. press assisst:
  5. uncheck open as read only
  6. check owner user of file systemand write your username:remon
  7. press ok
  8. press apply
  9. umount Drive
  10. mount it

Note: if you can't change files to binary executables, go to special files and check permit execution of files as binaries, and go to step 7

share|improve this answer

If you mount a partition to a folder within /home/user it will be owned by the user. Here's the line I added to my /etc/fstab.

UUID=9e5bb53c-4443-4124-96a8-baeb804da204 /home/fragos/Data ext4 errors=remount-ro 0 1
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.