在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。
Bookmark and Share This Page
If you like this then please subscribe to the RSS Feed.
Save to Browser Favorites
Ask
backflip
blinklist
BlogBookmark
Bloglines
BlogMarks
Blogsvine
BuddyMarks
BUMPzee!
CiteULike
co.mments
Connotea
del.icio.us
DotNetKicks
Digg
diigo
dropjack.com
dzone
Facebook
Fark
Faves
Feed Me Links
Friendsite
folkd.com
Furl
Google
Hugg
Jeqq
Kaboodle
kirtsy
linkaGoGo
LinksMarker
Ma.gnolia
Mister Wong
Mixx
MySpace
MyWeb
Netvouz
Newsvine
PlugIM
popcurrent
Propeller
Reddit
Rojo
Segnalo
Shoutwire
Simpy
Slashdot
Sphere
Sphinn
Spurl.net
Squidoo
StumbleUpon
Technorati
ThisNext
Webride
Windows Live
Yahoo!
Email This to a Friend