在linux挂载的fat32分区上无法使用svn的问题,以及keywords:Id
授权方式:署名,非商业用途,保持一致,转载时请务必以超链接(http://www.fwolf.com/blog/post/165)的形式标明文章原始出处和作者信息及本声明。在ubuntu Linux下搭建了svn服务器,工作正常,svn的档案respository存放在挂载的一个fat32分区中,apache的用户www-data也加入了plugdev组,能够正常读写svn的档案。
svn server build on ubuntu, apache, work fine. and svn respository is on mounted fat32 partition, and have add apache’s user www-data to plugdev group, so apache can r/w svn respository.
但是当在fat32分区中使用svn客户端,checkout或者update文件的时候,却发生了错误:
but when use svn client on fat32 partition, failed:
Authentication realm:
Password for ‘guest’:
svn: Can’t set file ‘trunk/.svn/entries’ read-only: Operation not permitted
原来,在Linux中,有些文件是不允许非所有者owner用户修改的(不知道是核心功能就禁止这样,还是一些软件按照这个规则来实现的?),即使当前用户有读、写权限。现在遇到的这个例子就说明svn客户端就是这样,所以我们必须把svn要操作的文件(.svn/entries什么的)的所有者owner改掉。
it’s because, in linux, some file are not write able to user who is not its owner, althought the operate user have write priv, this is a example. so to make svn run right, we must change owner of mounted fat32 partition.
Password:
chown: changing ownership of `svntest’: Operation not permitted
然而挂载的fat32分区还无法修改owner,那就只能通过修改/etc/fstab文件来实现了:
it seems that we cannot change owner of mounted fat32 partition, so we can only modify fstab file. open /etc/fstab, change the line
to / 改为
vfat是分区格式(fat32),utf8是分区的字符集iocharset,umask是挂载时不分配的权限,gid 46时组“plugdev”,uid 1000就是我使用的用户fwolf。
vfat is partition fstype, utf8 is iocharset, umask is privilege not give when mount, gid 46 is group “plugdev”, uid 1000 is me — fwolf.
现在重新mount这个分区,所有分区上的文件的owner就是用户fwolf了,这也是我日常使用的用户,现在再来使用svn客户端就一切正常了。
then remount the partition, the all file on this partition is owned by fwolf, and user fwolf use svn client finely.
不过这样虽然解决了问题,但是如果多用户同时使用一台主机的同样一个fat32分区,还是无法解决,多用户的话还是把分区格式转换成ext3吧,大不了以后不用的时候再转过去。
$Id$的自动修改
和windows下的客户端类似,我以前介绍过,在Linux下编辑/etc/subversion/config,添加:
enable-auto-props = yes
[auto-props]
*.html = svn:keywords=Id
就可以自动替换所有.html文件里的$Id$了。
update @ 2006-5-24
后来发现这种把仓库存在fat32分区上的方式,虽然能够正常的checkout,但是checkin/commit的时候,会出现svn无法chmod的错误,所以仍然需要把svn的仓库存放在ext3分区上,并且把目录owner设为www-data。
![[Bloglines]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/bloglines.png)
![[co.mments]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/comments.png)
![[del.icio.us]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/digg.png)
![[diigo]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/diigo.png)
![[Facebook]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/facebook.png)
![[Furl]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/furl.png)
![[Google]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/google.png)
![[MySpace]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/myspace.png)
![[Reddit]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/reddit.png)
![[Rojo]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/rojo.png)
![[Slashdot]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/technorati.png)
![[Windows Live]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/email.png)