Score:0

NFS with FS-Cache - set up, but still says it's disabled

cn flag

I have about the same problem as this one here, but that one seems to have been solved because cachefilesd hasn't been enabled. I have it enabled (removed the comment before RUN=yes in /etc/default/cachefilesd) and restarted the service, yet I still get

root@pc01:~# cat /proc/fs/nfsfs/volumes
NV SERVER   PORT DEV          FSID                              FSC
v4 86826879  801 0:46         0:0                               no

Other outputs from things mentioned in the other post are:

root@pc01:~# mount
[snip]
/fscache.img on /var/cache/fscache type ext4 (rw,relatime)
server:/shares on /shares type nfs4 (rw,nosuid,nodev,noexec,noatime,vers=4.2,rsize=1048576,wsize=131072,namlen=255,hard,proto=tcp,timeo=50,retrans=2,sec=sys,clientaddr=xxx,fsc,local_lock=none,addr=xxx)
server:/home on /home type nfs4 (rw,nosuid,nodev,noexec,noatime,vers=4.2,rsize=1048576,wsize=131072,namlen=255,hard,proto=tcp,timeo=50,retrans=2,sec=sys,clientaddr=xxx,fsc,local_lock=none,addr=xxx)
[snip]

Yes, I have put the fscache into an ext4 formatted image file, roughly 10 GB big since I didn't want to create a separate partition and Btrfs doesn't support user_xattr for all I know.

root@pc01:~# lsmod | grep cachefiles
cachefiles             86016  1
fscache                389120  2 cachefiles,nfs
root@pc01:~# uname -r
5.16.11-76051611-generic
root@pc01:~# grep CONFIG_NFS_FSCACHE /boot/config-5.16.11-76051611-generic 
CONFIG_NFS_FSCACHE=y
root@pc01:~# lsb_release -a
No LSB modules are available.
Distributor ID: Pop
Description:    Pop!_OS 21.10
Release:    21.10
Codename:   impish
root@pc01:~# dmesg | grep cache
[    0.019397] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.019576] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.043975] random: get_random_u64 called from kmem_cache_open+0x2b/0x360 with crng_init=1
[    0.082514] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.082543] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.256293] PCI: pci_cache_line_size set to 64 bytes
[    0.262202] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[   45.997860] FS-Cache: Cache "mycache" added (type cachefiles)
[   45.997863] CacheFiles: File cache on loop0 registered
root@pc01:~# ps aux | grep cachefilesd
root        1147  0.0  0.0   2876  1172 ?        SNs  14:29   0:00 /sbin/cachefilesd
root        9650  0.0  0.0  21912  2416 pts/0    S<+  14:45   0:00 grep --color=auto cachefilesd
Score:0
cn flag

It seems after a few reboots it activated itself. I now get

root@pc01:~# cat /proc/fs/nfsfs/volumes
NV SERVER   PORT DEV          FSID                              FSC
v4 86826879  801 0:46         0:0                               yes

Strange but at least it's working

Richard Rosner avatar
cn flag
nevermind. I deleted the ext4 image today because the computer was dead slow with it. I'd like to use the main filesystem which is btrfs. But I don't know if it's capable of user_xattr and if it's already active. Because I just removed the mount so cachefilesd would just write into the directory without the mount, but even after a few restarts it still says not active.
Score:0
cn flag

Ok, it seems by default btrfs can't be used for it so I made a ext4 partition and mounted it to /var/cache/fscache with "auto,defaults,user_xattr" attributes. This works now. If anybody knows how to use a btrfs partition for that, please let me know.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.