[Linux-cachefs] notes I made for getting fs cache working on Debian

Shaya Potter spotter at cs.columbia.edu
Tue Aug 29 21:05:12 UTC 2006


there are somewhat ugly, but might be useful to someone.

-------

we now need to modify the kernel, build a userspace daemon and modified 
mount (that understand the fscache option) in order to the the 
NFS/FS-Cache combo working

everything one needs is at

http://people.redhat.com/~steved/fscache/

1) http://people.redhat.com/~steved/fscache/cachefilesd/ <- contains 
userspace setup tool/daemon

it's available as a source rpm, I just used

rpm2cpio sourcerpm |cpio -i

to extract it and then built it.

However, it wasn't "easy"

one needs to run automake and autoconf, but automake will complain about 
files missing, they are readily available on the system in the automake 
dir so just copy them into place ("locate" them)

the main thing that was a problem is that it needs glibc 2.4, 
unfortunately debian still is using 2.3, however 2.4 is available in 
"experimental" as 2.3.999 and that works fine.

so make ; make install

however, it won't work yet as need a patched kernel

2) http://people.redhat.com/~steved/fscache/patches/ <- contains all the 
kernel patches

apply all of them.  Unfortunately they aren't listed in appropriate 
order via the web, so might have come "failures"

was easy enough to fix by looking at the rejected files.

then I did a "make oldconfig" on the kernel source code and enables the 
fs cache and enable nfs to use it, but didn't bother with afs.

I took the resulting bzImage and replaced the linux file in the tftpboot 
area with it and rebooted, and it worked.

we then need a "backing store" area this is a regular file system, ext2 
doesn't work but ext3 does.

so mkfs.ext3 some device.  it also needs xattr support so tune2fs -o 
user_xattr some device to enable it

then mount it on /var/fscache (within the pxe booted system)

we can now make sure /etc/cachefilesd.conf exists with a single line of 
"dir /var/fscache"

we can now run "cachefilesd -s" (for some reason don't get good output 
without -s) and if it says "Bound cache" everything is fine.

3) we need to modify util-linux to support the "fsc" option (so nfs will 
use the fs cache)

the patches and full source and redhat binaries are located at

http://people.redhat.com/~steved/fscache/util-linux/

however, the patch doesn't apply to any pure util-linux source, 
therefore one extract the full source (same method as above) in its own 
dir.  this results in a lot of files, mostly patches though.

one can read the .spec file to see the order of extraction and what 
order to apply the patch files (order is very important)

once the patch files are applied, one can then build it (./configure 
--prefix=/ ; make ; make install)

and now one can mount with the fs cache backing store

mount -t nfs -o fsc nfsserver:/share /mntpoint

and hoepfully everything should "work".




More information about the Linux-cachefs mailing list