1

I have 2 data sources. One is btrfs (raid) and one is a simple ext4 partition. Those should be transparently displayed as one. This is a simple read only example, but the lower/upper/workdir version produces the same problem, with btrfs as upper and ext4 as lower.

manual mount:

mount -t overlay overlay -o lowerdir=/mnt/raid/folder1/:/mnt/ext4/folder1 -o comment=merge  -o nfs_export=on /data/merged

fstab mount:

overlay /data/merged overlay defaults,lowerdir=/mnt/raid/folder1/:/mnt/ext4/folder1,comment=merge,nfs_export=on 0 0

this is my nfs export:

/data/merged 192.168.0.0/255.255.255.0(ro,fsid=1,async,insecure,crossmnt)

exportfs -ra produces: exportfs: /data/merged does not support NFS export

My configuration: Ubuntu 18.04 LTS with HWE kernel 4.18.0-13-generic This is my main source for the config: https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt

Maybe I am missing some NFSv4 stuff (which is needed for nfs exporting an overlayfs) ?

edit: as requested, my mounts for the sourcecs:

UUID=d138b8fa-83e1-4df7-80dc-c1ed7d866f77       /mnt/raid       btrfs   defaults        0       2
UUID=6bb8f391-0872-40cf-8aff-8bdb32632098       /mnt/ext4        ext4    errors=remount-ro 0 2

edit2:

grep -H . /sys/module/overlay/parameters/*
/sys/module/overlay/parameters/nfs_export:N
  • Just to rule out some weird settings, post the mount options of the underlying file systems. – anx Jan 20 at 3:14
  • What kernel do you run? The message indicates that NFS exports are not supported with your kernel yet. – Thomas Jan 20 at 8:45
  • @Thomas uname -a = "4.18.0-13-generic #14~18.04.1-Ubuntu SMP Thu Dec 6 14:09:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux" how can I find out if the kernel supports it? The feature is "availble" since 4.16 – wuppi Jan 20 at 11:37
  • That kernel version should support it. You may want to add the kernel version and the output of grep -H . /sys/module/overlay/parameters/* to your question. – Thomas Jan 20 at 12:18
  • result /sys/module/overlay/parameters/nfs_export:N --- so no support? – wuppi Jan 20 at 12:22
1

From kernel.org and from dmesg while trying to reproduce the error you also have to specify

  • -o index=on
  • -o index=on -o redirect_dir=nofollow when there is no upperdir

Your mount command then should be as follows.

mount -t overlay overlay -o lowerdir=/mnt/raid/folder1/:/mnt/ext4/folder1 -o comment=merge -o nfs_export=on -o index=on -o redirect_dir=nofollow /data/merged

The output of

/sys/module/overlay/parameters/nfs_export:N

shows the default of the mountoption and verifies that it is actually available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.