LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   sudo chown : operation not permited (https://www.linuxquestions.org/questions/ubuntu-63/sudo-chown-operation-not-permited-543589/)

shreef 04-05-2007 11:51 AM

sudo chown : operation not permited
 
Hi :)

I'm a new linux user. I have a problem when trying to chown or chgrp the files on my Ubuntu 6.10.

see this
Code:

ahmed@shreef:/media/hda2$ su - root
Password:
root@shreef:~# cd /media/hda2
root@shreef:/media/hda2# chown ahmed "my docs"
chown: changing ownership of `my docs': Operation not permitted

also, if I try to chmod 777 the files, I get the files only changed to be 770. it will look like that :

Code:

root@shreef:/media/hda2# ls -l
total 176
drwxrwx---  9 root plugdev 16384 2007-01-21 17:53 cygwin
drwxrwx--- 22 root plugdev 16384 2007-01-20 00:01 Dev tools
drwxrwx---  7 root plugdev 16384 2007-03-03 15:57 e - Library
drwxrwx---  8 root plugdev 16384 2007-04-04 14:13 linux-programs
drwxrwx---  5 root plugdev 16384 2007-02-15 06:15 my docs
drwxrwx---  3 root plugdev 16384 2007-01-20 19:48 Recycled
-rwxrwx---  1 root plugdev    27 2007-03-26 15:58 router.txt
drwxrwx--- 15 root plugdev 16384 2007-02-15 06:20 server
drwxrwx---  3 root plugdev 16384 2007-01-19 08:45 System Volume Information
drwxrwx--- 15 root plugdev 16384 2007-01-19 22:55 win programs


this permissions problem is driving me crazy, I'm trying to compile php and mysql from source, but I always get some errors related to this permissions problem.

thank you :)

{BBI}Nexus{BBI} 04-05-2007 12:11 PM

How to change files/folders ownership

sudo chown username /location_of_files_or_folders

If you want to change ownership of all containing files and folders recursively, use the -R option like this:

sudo chown -R username /location_of_files_or_folders

How to change files/folders group ownership

sudo chgrp groupname /location_of_files_or_folders

If you want to change group ownership of all containing files and folders recursively, use the -R option like this:

sudo chgrp -R username /location_of_files_or_folders

shreef 04-05-2007 12:24 PM

:) I tried all this commands before, but the same problem.

thanks for the Webmin advice :).I'm familiar with the CLI, but this can be helpful too.

thanx :)

{BBI}Nexus{BBI} 04-05-2007 12:57 PM

Quote:

Originally Posted by shreef
:) I tried all this commands before, but the same problem.

thanks for the Webmin advice :).I'm familiar with the CLI, but this can be helpful too.

thanx :)

Try chown ahmed:ahmed [name of folder] and chgrp ahmed:ahmed [name of folder]

Have allowed for the fact you have a space between my & docs?

shreef 04-05-2007 02:24 PM

it's the same too

Code:

root@shreef:/media/hda2# chown ahmed:ahmed "my docs"
chown: changing ownership of `my docs': Operation not permitted

I don't think that the space in the name of the folder is the problem as this happens with all the files/folders.

I read before about something called fsktaps and mounting the HD. I don't know if these things are related to this problem. I can read and write to/from my fat32 partitions without problems, but I can't change the permissions of the files/folders even when working as root user. what I understand is that the root user can do every thing whatever it is this thing, but in my case, the root user can't even get in his shoes without help ... lol

thanx :)

shreef 04-14-2007 06:27 AM

I have fixed chmod's problem. I found umask=007 for all the partitions in the fstab file. I have changed it to be umask=000 .

the main problem still exists. I can't use chown or chgrp, even if I'm logged as root.

any body met this problem before?

thanx

aysiu 04-14-2007 11:38 AM

You can't chown or chmod FAT32 or NTFS partitions. Permissions for Windows partitions are defined only by umask.

shreef 04-16-2007 04:31 AM

Aha!
yes, after trying, I found that I can only chown my EXT drives. I was afraid that I did something wrong while installing Ubuntu.

thank you aysiu :)

BlackWidower 04-19-2007 03:19 PM

So how can one edit files on a vfat volume in Linux?

mkhan919 04-20-2007 08:58 AM

errrrrrrrrr...... i dont think you need to do anything special with vfat. Just mount the partition and you should be able to write data do it. vfat does not require any special driver etc for writing from linux.

If you are unable to write to vfat partition, check the permissions. may be you are mouting the file system as read only. change that to "rw" and you should be all set.

BlackWidower 04-24-2007 02:59 PM

let me rephrase...So how can one's user (not root) account edit files on a vfat volume in Linux? Because I tried -o rw

mkhan919 04-24-2007 04:26 PM

on my machine this mounts the external hardisk partition sdb2 on /mnt/Temp.
All users can access and write to this partition.


/dev/sdb2 /mnt/Temp auto rw,noexec,nosuid,nodev,sync,user 0 0


Alternatively, you can replace auto with vfat (since you know that the filesystem is vfat).

If this this does not work try this..

/dev/sdb2 /mnt/Temp auto umask=0000,rw,noexec,nosuid,nodev,sync,user 0 0

which is basically the same but with the umask field added. Hope this helps.

BlackWidower 04-26-2007 03:29 PM

Ok that is it! I have officially tried everything! I mounted it in a different location, change the parameters, and no matter what I do the directory won't mount rw for users, and the permissions are stuck! sigh...do I need special software?

BlackWidower 04-26-2007 03:30 PM

oh btw thanks for your help mkhan! :)

BlackWidower 06-13-2007 09:25 PM

For those who were wondering I fixed my problem. Vfat volumes don't store owner information so Linux automatically assigns it as root. Its not easy to switch data to a different filesystem on the same drive...I lost data in the transfer. :'(


All times are GMT -5. The time now is 09:50 PM.