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 patches below are 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). The first patch was prepared for Ubuntu 16.04 (and hence Thunar 1.6.10.) It seems to work on Ubuntu 18.04 (Thunar 1.6.15), on downloaded sources of Thunar 1.8.4, and on Ubuntu 20.04 (Thunar 1.8.14). The second was mildly updated for 1.8.14, with slight improvements to the added code. They are provided here mostly in the hope that it will inspire someone else to make a better patch.
Patch for Thunar 1.6.x / 1.8.x
(If running Ubuntu,
- Create basic build environment:
# apt-get install build-essential fakeroot devscripts
- Install Thunar's build dependencies:
# apt-get build-dep thunar
- Get sources, not as root, into current directory:
$ apt-get source thunar
cd thunar-1.6.10 patch -p1 < ~/Downloads/Ubuntu_thunar-1.6.10_NFS-quota.patch
Do not worry if the debian/changelog patch fails, as it will with everything apart from Ubuntu 16.04. Which patch to use? The 1.8.14 one is probably best for 1.8.x, and the 1.6.10 one for 1.6.x, but I have not tested all combinations, and the 1.8.14 patch contains minor improvements to the added code.
(If running Ubuntu,
- Fix version number
$ debuild -b -uc -us
- Install, as root, the packages being one directory level up from
the build directory, and adjusting version numbers/architectures
# dpkg -i libthunarx-2-0_1.6.15-0ubuntu2_amd64.deb thunar_1.6.15-0ubuntu2_amd64.deb thunar-data_1.6.15-0ubuntu2_all.deb
Patching sources of 1.8.4 directly
$ wget http://archive.xfce.org/src/xfce/thunar/1.8/Thunar-1.8.4.tar.bz2 $ wget http://www.mjr19.org.uk/IT/Ubuntu_thunar-1.6.10_NFS-quota.patch $ tar -xf Thunar-1.8.4.tar.bz2 $ cd Thunar-1.8.4 $ patch -p1 < ../Ubuntu_thunar-1.6.10_NFS-quota.patch [debian/changelog patch will fail] $ ./configure $ make # make install