From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <181f918ef3641b854a5fcd822a1973e5@gmx.de> To: 9fans@9fans.net Date: Fri, 8 May 2009 18:27:28 +0200 From: cinap_lenrek@gmx.de MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] cwfs Topicbox-Message-UUID: f6a3687a-ead4-11e9-9d60-3106f5b1d025 Have converted my fossil/venti filesystem to cwfs (with history) and made boot code so that i can start off from it. On the way i had to change cwfs a bit so that it can cope with the long filenames from my mp3 collection and as it was supposed to run on my cpu server, i reduced the cache memory size to be a quarter of all free userspace memory. converting fossil to cwfs: used the cphist program from http://www.quanstro.net/plan9/history.pdf and wrote a /dev/(bin)time faking fileserver (/n/sources/contrib/cinap_lenrek/delorean) that fools cwfs and replica about the current time, but does not confuse cron and fossil. you have to manualy convert fossils /adm/users to cwfs format. the sequence is this: start cwfs type "allow" and "users default". then mount it and copy a users file in the root. then type "users /users" and remove the file again before doing the replica. after replica copy that file again to /adm/users so that on next startup the owners and groups get loaded correctly. for the replica you better make a script and check the fossil dumps for corrupted directories. i had several metadata corruptions in the root direcotiry of fossil dumps that caused replica to remove anything just to recreate it on the next round. in the end i made a list of bad dumps that got skpied in the script. the good news is that you can do all this while your fossil cpuserver is running so if you find problems you can start over again and to crazy things while anything is still running. booting from cwfs: /n/sources/contrib/cinap_lenrek/local.c (copy to /sys/src/9/boot/local.c) the important part of the kernel configuration looks like this: boot cpu boot w0 tcp local bootdir bootpccpuc.out boot /386/bin/ip/ipconfig /386/bin/auth/factotum /386/bin/cwfs cwfs as the original stand alone fileserver has its own device names. cwfs needs a device mapping file that maps plan9 files to cwfs devices. connectlocalcwfs() builds that mapping dynamicly from plan9.ini keys in the form wN=file. so my plan9.ini looks like this: bootfile=sdE0!9fat!9pccpuc bootargs=local!w0 bootdisk=local!w0 w0=#S/sdE1/data on boot, cwfs is started in config mode so one can recover from errors. after typing "end" on the cwfscmd promt stdin of cwfs is put in /srv/cwfscmd and the filesystem gets mounted. misc: dont forget to change fshalt to do something like this: f=... k=... c=`{ls /srv/cwfs*cmd >[2]/dev/null} for (i in $c){ echo -n $i... echo halt >>$i } cwfs needs to be halted correctly as it has no jurnaling or softupdates. -- cinap