LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 994|回复: 8

fc5下的文件共享问题!

[复制链接]
发表于 2006-6-13 15:31:02 | 显示全部楼层 |阅读模式
我把win下的一个硬盘通过在fstab中添加
/dev/hda5              /mnt/windata             vfat    defaults        0 0
挂载在linux下的windata目录

可是只有在root下才有修改的权限,文件夹的所有者为root
然后我又在root下,利用chmod,来修改windata的属性,想使得一般用户也可以读写执行
可是改完了不起作用
我用的命令是chmod u+rwx  windata
然后在root用户下,利用chown来修改windata的属性,让其归另一个用户所有
chown  用户名 windata
结果,说chown: changing ownership of `windata': Operation not permitted


该怎么办呢?
我想让一般用户就拥有对windata的所有权限,应该怎么做?
发表于 2006-6-13 16:00:15 | 显示全部楼层
defaults: Uses the default options that are rw, suid, dev, exec, auto, nouser, and async.

改为:
/dev/hda5 /mnt/windata vfat rw,suid,dev,exec,auto,user,async 0 0
可能会工作。

参考:
http://www.tuxfiles.org/linuxhelp/fstab.html
http://www.tuxfiles.org/linuxhelp/mounting.html
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-13 16:31:30 | 显示全部楼层
Post by yichi
defaults: Uses the default options that are rw, suid, dev, exec, auto, nouser, and async.

改为:
/dev/hda5 /mnt/windata vfat rw,suid,dev,exec,auto,user,async 0 0
可能会工作。

参考:
http://www.tuxfiles.org/linuxhelp/fstab.html
http://www.tuxfiles.org/linuxhelp/mounting.html



改好重启还是不行阿
在root下利用chown 用户名 windata
提示还是一样的
chown: changing ownership of `windata': Operation not permitted
回复 支持 反对

使用道具 举报

发表于 2006-6-13 16:55:06 | 显示全部楼层
more /etc/passwd | grep YOURUSERNAME
/dev/hda3 /mnt/fat vfat uid=500,rw,exec 0 0
uid 设为你 那个 windata 用户的 uid

more /etc/passwd | grep windata
可以得到 UID
回复 支持 反对

使用道具 举报

发表于 2006-6-13 16:58:33 | 显示全部楼层
VFAT does not understand access permissions or ownership, so in Linux it
gets mounted with the default umask and ownership of whoever called mount.
You must specify the options umask, uid, gid in your fstab if you want them to
be different.  For example, I mount my windows partition with the following
line in /etc/fstab:

/dev/hdc1               /windows/D  vfat     rw,uid=501,gid=100         0            2

That assigns ownership to my personal user account and the 'users' group on my
machine. It also gives me my default umask 022, which results in the
permissions rwxr--r-- (755) on the mount directory and all subordinate
directories and files in that partition. Same thing you got.

If I wanted more liberal write permissions, give it a more liberal umask, for
example,

/dev/hdc1          /windows/D  vfat     rw,uid=501,gid=100,umask=000 0   2

a umask of 000, would result in permissions of rwxrwxrwx (777) on everything
in that partition.
回复 支持 反对

使用道具 举报

发表于 2006-6-13 17:00:06 | 显示全部楼层
I think I might have figured out what is going on. Since the type of the partition is vfat, the mount command is setting the permissions and owner to the default of the user that is mounting it. In this case, root. The default umask for root is set to 022 in the /etc/profile file. Hence the permissions are set to 755 on the mount point. I would think that by adding the option to the fstab to change the umask might be as simple.

/dev/hda7 /mnt/hda7 vfat defaults,umask=000 1 0

The umask is a bit mask used to set the actual permission bits. In this case it should set them to 777 because the mask is set to all zeroes. After making the change remount the partition.

This is the type of case where I can learn as well. Because I never use vfat partitions on production machines, I have never had to deal with it before. I was only able to test it using a floppy disk, but it worked.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-13 17:23:34 | 显示全部楼层

解决了
多谢,多谢!
回复 支持 反对

使用道具 举报

发表于 2006-6-13 18:05:02 | 显示全部楼层
好贴,有时间译一下.
回复 支持 反对

使用道具 举报

发表于 2006-6-13 18:05:51 | 显示全部楼层
好贴,有时间,译一下.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表