Other A unionfs cannot be nfs mounted?

hruodr

Well-Known Member

Reaction score: 46
Messages: 362

I have a directory /nfsexport/fbsd112 (with a whole FreeBSD root) and two empty directories /nfsexport/union and
/nfsexport/union. I do first cd /nfsexport.

The command mount_nfs 10.0.0.1:/nfsexport/fbsd112 test succeds, but not the following:

Code:
# mount_unionfs -o below fbsd112/ union
# mount_nfs 10.0.0.1:/nfsexport/union test
[tcp] 10.0.0.1:/nfsexport/union: Permission denied
Is it so, that a unionfs cannot be nfs mounted?

I need such a thing in order not to have for every discless client a coppy of each file of FreeBSD root.

Any Idea what to do?

I tried also with PXE boot: the discless client does not boot if the root is a unionfs.
 

roccobaroccoSC

Well-Known Member

Reaction score: 96
Messages: 426

Are you sure you are mounting them in the right order? Also, is the top layer read-write?

Could you try also via fusefs-unionfs?

Bash:
 pkg install fusefs-unionfs

mkdir /nfsexport/mnt
unionfs \
    -o cow,max_files=32768 \
    -o noatime,allow_other,use_ino,suid,nonempty \
    "/nfsexport/union"=RW:"/nfsexport/fbsd112"=RO \
    "/nfsexport/mnt"
# and then try exporting /nfsexport/mnt
 

roccobaroccoSC

Well-Known Member

Reaction score: 96
Messages: 426

P.S. mount_unionfs has the following warning in its man page:
BUGS
THIS FILE SYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T WORK)
AND USING IT MAY, IN FACT, DESTROY DATA ON YOUR SYSTEM. USE AT YOUR OWN
RISK. BEWARE OF DOG. SLIPPERY WHEN WET. BATTERIES NOT INCLUDED.
 

roccobaroccoSC

Well-Known Member

Reaction score: 96
Messages: 426

By the way, what are you trying to achieve exactly?
Do you want to have /nfsexport/fbsd112 as a read-only layer on the bottom and then mount a remote NFS share on top of it as a R-W customization?
In this case you could do the following:

1. Mount the NFS share in a directory first.
2. Then mount via unionfs /nfsexport/fbsd112 as a R/O on the bottom and the NFS mounted directory as R/W on the top. Mount them into a brand new directory, for example /nfsexport/mnt.
 
OP
OP
H

hruodr

Well-Known Member

Reaction score: 46
Messages: 362

Do you want to have /nfsexport/fbsd112 as a read-only layer on the bottom and then mount a remote NFS share on top of it as a R-W customization?
Yes, that, but all must be nfs mounted: the client is diskless and I need at the very beginning a root with /boot, an /etc/fstab, a /sbin/init and something more (eg. some /etc/rcXXX and dependencies).
 
OP
OP
H

hruodr

Well-Known Member

Reaction score: 46
Messages: 362

I have no experience with fuse. I will try first making the unions in the client after nfs exporting.
 
Top