Thunar and Quotas

Many GUI filemanagers fail to report quotas on remote filesystems, instead reporting the physical free space. This is unhelpful for users if quotas exist, and quotas are common in many academic environments. This page serves to describe a patch to Thunar which adds NFS quota support.

Thunar is XFCE's GUI filemanager. It is designed to be fairly light-weight, and to use exclusively GVFS calls from the GTK. As GVFS does not support quotas, Thunar also does not, but, with an unofficial patch, anything is possible...

The patch below is provided with no claim that it is fit for any purpose: use at your own risk. Also included are notes on how to apply such a patch, assuming one is running Ubuntu (or, presumably, anything based on Debian). An old page describes a patch using the original Sun (TS-)RPC interface which works for Ubuntu LTS up to 20.04 inclusive, but it is now better to use TI-RPC, which is what the patch on this page does. Glibc used to support Sun's original RPC, but no longer does.

The relevant bits of Thunar's source seem quite stable, in that either patch will probably work on anything from 1.6.x to 4.16.x. The patch given here was prepared for 4.16.10 as supplied by Ubuntu 22.04. It is provided mostly in the hope that it will inspire someone else to make a better patch. It is the first piece of TI-RPC code I have written, so it may be less than perfect.

Patch for Thunar 4.16.x

(If running Ubuntu,

)

Apply this patch for 4.16.10 with something like:

  cd thunar-4.16.10
  patch -p1 < ~/Downloads/Ubuntu_thunar-4.16.10_nfs-quota.patch

(If running Ubuntu,

)

Patching sources of 4.16.10 directly

$ wget http://archive.xfce.org/src/xfce/thunar/4.16/thunar-4.16.10.tar.bz2
$ wget http://www.mjr19.org.uk/IT/thunar-4.16.10-nfs_quota.patch
$ tar -xf thunar-4.16.10.tar.bz2
$ cd thunar-4.16.10
$ patch -p1 < ../thunar-4.16.10-nfs_quota.patch
$ CPPFLAGS=-I/usr/include/tirpc ./configure
$ make
# make install