1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

zfs sharenfs

Discussion in 'Web and Network Services' started by gettons, Mar 7, 2011.

  1. gettons

    gettons New Member

    Messages:
    19
    Likes Received:
    0
    Hi all,

    I am playing with zfs sharenfs and I came across a problem. Unless I put a single host/network, I don't get any export after showmount -e
    I presume because the syntax is not quite right... What I need to do is to export:

    Code:
    /media 192.168.3.0/24 192.168.4.3 192.168.4.21
    So not just a network, but also some other hosts. Is it possible to do this with zfs feature? What I tried is the following:

    Code:
    zfs set sharenfs="-network=192.168.3.0,-mask=255.255.255.0,-alldirs,192.168.4.2" stuff/installs
    But it doesn't like it.
     
  2. thuglife

    thuglife New Member

    Messages:
    160
    Likes Received:
    0
    You don't need commas. Try the following:

    Code:
    zfs set sharenfs="-alldirs -network=192.168.3.0/24 192.168.4.2" stuff/installs
     
  3. gettons

    gettons New Member

    Messages:
    19
    Likes Received:
    0
    Didn't work either :-(
     
  4. thuglife

    thuglife New Member

    Messages:
    160
    Likes Received:
    0
    Ok, it doesn't work because it's invalid export syntax.

    Code:
    zfs set sharenfs="-alldirs -network=192.168.3.0/24" stuff/installs
    This works for me, but I don't know how you are going to handle the single host. Nevertheless this has nothing to do with the sharenfs property per se, we need someone with more experience in the syntax.
     
  5. ian-nai

    ian-nai New Member

    Messages:
    49
    Likes Received:
    0
    Hmm, the man page doesn't list a "=" sign in the network spec. If I understand the sharenfs property, whatever syntax /etc/exports handles should work in zfs set sharenfs="..." on a "per line" basis.

    Looks like in /etc/exports you would create two lines. One specifying the range of addresses to export to and another line to specify any singular hosts. Try issuing two, separate zfs set sharenfs="..." commands.
     
  6. phoenix

    phoenix Moderator Staff Member Moderator

    Messages:
    3,407
    Likes Received:
    2
    sharenfs only works for the "simple" case, as it only holds a single line of text, and thus, only generates a single line in the /etc/zfs/exports file.

    If you want to do anything involving more than 1 line of text in an exports(5) file, then you need to do it manually via /etc/exports
     
  7. gettons

    gettons New Member

    Messages:
    19
    Likes Received:
    0
    This makes sense.
    Unfortunately if you run zfs set .... onlyt the last one would be valid.