NFS export an overlay of ext4 and btrfs

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) ?

Btrfs check repair give device busy. How to see what it keeps busy?

I am in a chicken-egg situation for my secondary harddrive (non boot):

  • My BTRFS mount has gone readonly because no space left.
  • btrfs filesystem resize only works on mounted volumes.
  • I needed to umount this ro mount in force mode (because of device busy).
  • If I try to mount rw it fails because of errors (most likely caused by no space left)
  • If I try to run btrfs check --repair it gives device busy

What to do to find out what keeps /dev/sda busy? My hdd is listed in /etc/fstab, does that matter (UUID=262a8d86-279a-4f6b-8968-32e200c32255 /mnt/hdd btrfs defaults,compress=zlib 0 1)???

I tried:

  • lsof | grep /dev/s -> nothing
  • lsof | grep /mnt/hdd-> nothing
  • The same for fuser -> nothing

So:

mount -o recovery /dev/sda /mnt/hdd

[63035.539792] BTRFS error (device sda): Remounting read-write after error is not allowed

If I try to run:

root@myhost:/mnt# btrfs check --repair /dev/sda enabling repair mode ERROR: cannot open device '/dev/sda': Device or resource busy ERROR: cannot open file system