Archive for December, 2008

fsize

December 29th, 2008

当ZFS启用了压缩之后,文件的真实大小(ls看到的)和你用df/du看到的大小已经不一样,因此写了这个sh来统计目录下的文件的真实大小,即ls列出来的大小,在此保存一下。

http://www.chifeng.name/dist/scripts/fsize

缺点:不支持大量文件。

很快会再写一个Perl版本的或者Python版本的fsize,就解决这个问题了,shell版本的不知道如何修复这个问题。

Postfix China Mirror Site

December 19th, 2008

创建了一个Postfix的镜像站点,每天晚上零点更新一次,欢迎访问,地址如下:

WEB站点
http://mirror.postfixchina.org

下载站点
http://mirror.postfixchina.org/downloads/

zfs for munin

December 17th, 2008

在使用ZFS的过程中,我想监控到每一个pool的读写速度的历史数据,但是munin里面并没有这个脚本,因此便自己写了一个,收集指定的pool的读写速度数据,形成图表。

哪位老大需要可以直接下载使用,我在OpenSolairs 200811版中测试没问题。

下载地址:

http://www.chifeng.name/dist/patch/zfs_poolname

ZFS Problem

December 9th, 2008

测试zfs的过程中碰到的问题

1. 创建pool的时候,把一块硬盘分了4个分区,使用如下命令创建成功
root@chifeng:~# zpool create test c3t5d0p1 c3t5d0p2 c3t5d0p3 c3t5d0p4 c3t5d0p0

不是很明白Solaris的分区原理,不过从这儿看的话,p1-p4代表了我的四个分区,而p0则代表了整块硬盘,但是为什么又可以同时使用呢?并且test的大小的确变成了2倍,bug?还是?

2. 删除一个pool的时候挂死了
root@chifeng:~# zpool create test c3t5d0p1
cannot create ‘test’: pool already exists
root@chifeng:~# zpool destroy test

^C^X^C
root@chifeng:/etc# sync

^C^C^C^X^C

我在执行如上两个命令,想重新创建pool的时候,挂死在这儿了,至今还未恢复,在另外一个窗口kill -9也不行,执行sync命令也挂死,看似只有靠reboot了。

3. 可算是懂点format命令了,连蒙带猜的知道Solaris分区的意思了
他预先分配了一些设备号来用,但是如果不在format里面分好,他是不能用的,虽然有这个设备号。
另外到现在我还没弄明白partition和slice的对应关系。Solaris的真是难用啊,唉。。。偶还算有点经验,折腾了1天居然还没把分区这事搞明白。难怪流行性不如Linux/FreeBSD,用户体验太差!

policyd2

December 4th, 2008

I ran into a few problems with this port. First of all you had a bad path in
one of your depends (fixed). But, the main problem is docs install. Several
points, the use of %%PORTDOCS%% in the pkg-plist is deprecated and being
removed from all ports. Secondly all ports now must respect NOPORTDOCS,
NOPORTEXAMPLES and NOPORTDATA. I fixed your install to respect these flags and
moved two folders out of ${DOCSDIR} that belong in ${DATADIR}. Try and avoid
using ${CP} and ${MKDIR} in the makefile. Also, it’s not necessary to list
your docs in the pkg-plist at all that’s now all handled by PORTDOCS= in the
Makefile same with PORTEXAMPLES and PORTDATA. If you have many files and
directories you can use the “*” (wildcard) character rather than clutter up
the Makefile. Rule of thumb is 4 lines of filenames max. Another point,  it’s
not a good idea to redefine ${DOCSDIR}. Users expect to find docs under the
portname in /usr/local/share/doc/${PORTNAME}, changing that to “cluebringer”
will only serve to confuse them. And finally, we never include the license in
docs. They are already in the tree and there are  already hundreds of copies

mistakenly put in docs.

Beech老大不厌其烦的解释了我port的这些问题,记录一下,以后注意不再犯错。
我立马改了,并且刚想upload了一个新的,还没来得及,再回头看邮件,发现Beech老大已经把patch发过来了。
服!!老大们总是喜欢直接给 patch!!
于是,又赶紧退回原来版本,测试了一下patch,没有问题,便回信告诉老大ci吧。。。
http://www.freebsd.org/cgi/query-pr.cgi?pr=129385