LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   why the root user can not change the ownership of a hard drive, and how to do that (https://www.linuxquestions.org/questions/slackware-14/why-the-root-user-can-not-change-the-ownership-of-a-hard-drive-and-how-to-do-that-803607/)

seflyer 04-22-2010 04:31 PM

why the root user can not change the ownership of a hard drive, and how to do that
 
Hi all,
I have Slackware 12.2 installed on my computer, as well as a Windows Xp. I have a hard drive named '/fat-d', which is formatted to be 'fat' and is normally used under XP. This drive can also be accessed under Slackware, both as root and the normal user.
I can not write to the directory '/fat-d' when I am not root, it is normal since 'ls -l' shows that its owner is root and other users have no permission to write.
The problem is that, when I tried (as root) to change the owner to the normal user:

# chown [normal_user_name] /fat-d

I got an error:

chown: changing ownership of '/fat-d/':Operation not permitted

But how can the root have no permission to change the owner?
Any idea?
Thanks in advance!

Hao

acid_kewpie 04-22-2010 04:34 PM

you can't change it becuase no one owns it in the first place. fat filesystems are not posix compliant so there is nowhere for this data to be stored. as such you have options like the uid and gid options which can be used with the mount command to fudge these options in to fat mounts.

halborr 04-22-2010 04:41 PM

^^ i.e. "id" to find user/group id numbers of the user, then "mount -o gid=100" (that's the user group number on this specific box)

seflyer 04-23-2010 07:01 AM

Quote:

Originally Posted by acid_kewpie (Post 3944468)
you can't change it becuase no one owns it in the first place. fat filesystems are not posix compliant so there is nowhere for this data to be stored. as such you have options like the uid and gid options which can be used with the mount command to fudge these options in to fat mounts.

Thanks! I do have questions.
Firstly, I think root does behave as a 'owner', at least I can write or delete things in this fat disk as I wish when I logged in as root.
Second, I don't quite understand what you have said... but I will try to figure it out.

voyciz 04-23-2010 08:40 AM

Quote:

Originally Posted by seflyer (Post 3945080)
Thanks! I do have questions.
Firstly, I think root does behave as a 'owner', at least I can write or delete things in this fat disk as I wish when I logged in as root.
Second, I don't quite understand what you have said... but I will try to figure it out.

What he's saying is that nix filesystems store the permissions for all files on the disk. On MS filesystems, permissions are nonexistent. So when you mount one under Linux, imaginary permissions are created to be consistent. Similar to how you can view files on an audio CD, when really there are no files.

rworkman 04-23-2010 08:58 AM

http://slackwiki.org/Windows_Partitions

seflyer 04-23-2010 07:20 PM

Thanks for your explanation voyciz!
And the link is so helpful, problem solved now. Thank you rworkman.


All times are GMT -5. The time now is 11:31 AM.