2

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
wuppi
  • 123

1 Answers1

7

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.

Thomas
  • 4,415