rm: 没法删除"/run/user/root/gvfs": 是一个目录 问题

2013-03-02 
 
bxd@linux:~$ sudo su
[sudo] password for bxd: 
root@linux:/home/bxd# exit
exit
rm: 没法删除"/run/user/root/gvfs": 是一个目录
bxd@linux:~$ 
 
------------------------------
这彷佛是一个bug, 我也不清楚怎么回事。 解决办法好像是在退出以前运行 umount /run/user/root/gvfs ,而后就能够删除这个目录了。
参见 : 
http://askubuntu.com/questions/233668/r ... -directory
https://bugs.launchpad.net/ubuntu/+sour ... ug/1077569
 
 
******************************
root下没法读写文件探究
2012-08-24 
 
1 在root权限下没法复制~/.gvfs/,也没法删除~/.gvfs/
备份/home时出错
/usr/share/backup# ./backup
  cp: 没法获取"/home/hic/.gvfs" 的文件状态(stat): 权限不够
  tar: 2012-08-24_17_06_53:没法 stat: 没有那个文件或目录
  tar: 因为前次错误,将以上次的错误状态退出
 
.....................................
 
6 尝试卸载~/.gvfs/,居然成功 
按照网上的说明,使用mount卸载
 
~# umount .gvfs/
 
没有报错,说明卸载成功
 
7 ~/.gvfs是gvfs-fuse的挂载点 
下面是一段关于gvfs的介绍:
 
  What is the "fuse-daemon"?
  
  gvfs-fuse-daemon mounts your network connections as local file
  systems. The .gvfs dir is where any mounted network/other file systems
  are stored.
  
  For example: if you connect to you cellphone via the other:\\ prtocol,
  that directory wiil be mounted under the .gvfs dir so that legacy
  applications can access it.(like the terminal)
 
 
8 卸载以后 
 
~# ll | grep .gvfs/
  drwx------  2 hic  hic   4096  8月 21 19:15 .gvfs/
 
此时,已经能够使用root进入,也能够复制甚至删除。
 
 
9 重启以后此文件仍旧会出现 
 
可是它的权限仍旧和以前未卸载同样,root权限下不能复制和删除。
 
10 在root权限下仍旧不能查看 
 
~$ sudo -s
~# ll -d .gvfs/
  ls: 没法访问.gvfs/: 权限不够
 
11 在通常用户权限下,却能查看,复制甚至删除 
 
~$ ll -d .gvfs/
  dr-x------ 2 hic hic 0  8月 24 18:43 .gvfs//
 
12 找到网上的一篇说明 
 
  There is FUSE virtual filesystem mounted at ~/.gvfs.  For the majority
  of filesystem acceses, permissions are ignored for the root
  user. However, FUSE virtual filesystems mounts are one of the rare
  exceptions. FUSE virtual filesystems normally restricted to user who
  mounted them. In this case , the gvfs-fuse-daemon command(run as part
  of your desktop session)created this mount, belonging to you, and
  no-one else can access it, including root.
 
它的意思就是,该文件能够在普通用户权限下进行更改,可是除了该用户以外,
其它用户不可能对其进行读取或者删除,包括root也同样。
 
13 小结
 
在备份/home的时候,不能用root,不然没法复制.gvfs/出现错误。正确的作法是,以普通权限备份,这样就能避免该错误的发生。
相关文章
相关标签/搜索