I've installed a diskless Ubuntu system with the latest 64-bit Maverick kernel, by following the instructions found here:
However, the clients are not diskless and I want to take advantage of this by using a local cache of the nfs-mounted filesystem. I'm using fs-cache and the cachefilesd package for this purpose. Of course I want to cache the whole root file system and in order for that to work, the filesystem must be mounted with the "fsc" mount option.
Hence, in my fstab I have the following entry:
However, I can easily verify that the fsc mount option is not being used when mounting the root system:
/dev/nfs / nfs fsc 1 1
If I mount an nfs share manually after booting then it will use the fsc flag without any problems. However, I'd rather not try to remount the root file system, even if that might work.
# cat /proc/fs/nfsfs/volumes
NV SERVER PORT DEV FSID FSC
v3 81102339 801 0:17 562aac732e56f8ac no
I also learned that there's a special kernel option called "rootflags" that specifies the mount options for the root file system, so I tested modifying the kernel boot parameters as follows:
However, the root file system is still mounted without the fsc option.
append root=/dev/nfs rootflags=fsc initrd=ubuntu-boot/initrd.img-2.6.35-24-generic nfsroot=22.214.171.124:/data/nfsroot ip=dhcp rw
What do I need to do to enable the fsc mount option so that fs-cache will work?
According to the manpage for initramfs-tools, you should be able to specify the NFS mount options as a kernel parameter using NFSSERVER:NFSPATH:NFSOPTS, but I suspect this is not correct -- when I test it only works if I use the format NFSSERVER:NFSPATH,NFSOPTS. Perhaps the manpage needs to be updated?
The following manpage for NFS does not list fsc as one of the options:
However, the following does:
Is this because it's two different versions?
When I try to use the fsc option, I get the following error:
nfsmount: bad option 'fsc'