How to access zfs clone via nfs?

Status
Not open for further replies.

Knuuut

Dabbler
Joined
May 4, 2015
Messages
19
Hi,

I´m trying to access a zfs clone via nfs from a linux box. There is no problem to access the clone locally from the freenas box. The directory of the clone shows up on the linux box, but it is empty.

Code:
root@linux: /opt/nas/freenas/clone-auto-20150426.0145-3m# ls -al
drwxr-xr-x 2 root postgres 2 Mai 18 09:48 .
drwx------ 24 postgres postgres 24 Mai 18 09:48 ..

[root@freenas] /mnt/backup/freenas/clone-auto-20150426.0145-3m# ls -al
drwx------ 23 mailnull mailnull 23 Aug 25 2014 ./
drwx------ 24 mailnull mailnull 24 May 18 09:48 ../
drwx------ 4 mailnull mailnull 4 Sep 26 2014 files_a/
drwx------ 4 mailnull mailnull 4 Oct 20 2014 files_b/

[root@freenas] ~# cat /etc/exports
/mnt/backup/freenas -alldirs -maproot=root:wheel

root@linux: cat /etc/fstab
...
freenas:/mnt/backup/freenas /opt/nas/freenas nfs noauto,rw,async 0 0
...


I also tried to edit /etc/exports on freesnas by adding -crossmnt to the export, but it doesn't work. Freenas nfs dont´t know this option and complains "bad opt crossmnt".
Manually adding a nfs export of the clone works, but that's not an option.
What I am doing wrong?

Thanx

Knuuut
 
Last edited:
D

dlavigne

Guest
Note that a clone is its own filesystem so an -alldirs isn't sufficient. Have you tried mounting just the clone?
 

Knuuut

Dabbler
Joined
May 4, 2015
Messages
19
Thanks for your reply.

I've tried to mount the clone with no success.

Code:
mountd[3317]: mount request denied...


Thats why I've played around with some nfs options like crossmnt, but this didn't worked.
 
D

dlavigne

Guest
Just to be clear, you made an NFS share on the FreeNAS side that points just to the clone and you get that error when you try to mount that share?
 

Knuuut

Dabbler
Joined
May 4, 2015
Messages
19
No, as I wrote in my first post, exporting and mounting a clone is not an issue.

I'd explain my situation.
I'm exporting a ZFS dataset via NFS. No problem.
I'm doing a ZFS snapshot on this dataset. Again, no problem.
I clone the snaphot on this dataset. This clone appears on the NFS client as an empty directory and I don't know why.
If I additionally doing a NFS export of this clone, I can mount the clone on the NFS client. But I want to avoid this step.

I hope you know what I'm talking about for now.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
so you want the clone operation to create a nfs export automatically?
 

Knuuut

Dabbler
Joined
May 4, 2015
Messages
19
This could be an option if it works.
afaik this may be done by "zfs set sharenfs=on" on top dataset of the clone and this will be inherited to the clone.

Is this true?
 

Knuuut

Dabbler
Joined
May 4, 2015
Messages
19
Thank you for you comprehensive answer.

Any other suggestions are welcome.
 
Status
Not open for further replies.
Top