Fedora + Mounting NFS3 windows share.



  • I’m a noob with linux, but I think i know enough to just cause problems. I tried mounting a nfs share that i created on a windows 7 computer using freenfs sourceforge project. The permission on the folder and the share is set to give everyone and anonymous logon full control.

    On the linux box, I tried configuring the /etc/exportfs to reflect:
    /images *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=1)
    /images/dev *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=2)
    /mnt/FogImages *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=3)

    my fstab:
    …initial Default stuff…
    xxx.xxx.xxx.xxx:/FogImages /mnt/FogImages nfs nfsvers=3 0 0

    When I try to do mount -a, I get:
    mount.nfs: access denied by server while mounting xxx.xxx.xxx.xxx:/FogImages

    Looked up a few things on Google and tried it out, but i’m not getting it to work. I’m hoping someone is able to help me through this.

    Thanks in advance.



  • Windows share that use CIFS/SMB mount will only work with user space NFS server such as unfsd3 or NFS-Ganesha
    The regular kernel mode nfs_kernel_server does not compiled to support NFS re-export.


  • Moderator

    @koshia

    Since your images is located only at /mnt/FogImages/images

    then you don’t need this inaccurate line in your exports file: /mnt/FogImages * so delete that one.

    You’re exports file should look like this:

    /mnt/FogImages/images *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=0)
    /mnt/FogImages/images/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=1)
    

    You also need to set your permissons on this directory. Do that like this:

    chmod -R 777 /mnt/FogImages/images
    

    Then, inside of Storage Mangement -> Your storage ndoe -> Path
    Make sure that’s set as: /mnt/FogImages/images

    Then restart NFS (or reboot the server).

    systemctl restart nfs-server
    

    Also, since this is a remote directory mounted via CIFS, make sure that the username / password that you used to mount the directory has full permissions on this remote directory.

    Also,
    Ensure that your firewall is off and disabled at boot:

    systemctl stop firewalld.service;systemctl disable firewalld.service
    

    and ensure that SELinux is off. This is how you’d stop it, there is a config file to edit to prevent it at boot.

    setenforce 0
    

    To check the status of SELinux, you’d type

    sestatus
    


  • I just wanted to revisit this thread and provide a solution. The mounting of CIFS worked on the Linux system; however, I am running into a bit of a problem trying to image my first image.

    Error states Failed to Mount NFS Volume.

    I doubled checked and my /mnt/FogImages/images - has a .mntcheck file and so does /mnt/FogImages/images/dev.

    The second thing on the wiki was to check the /etc/exports. Here are my entries:

    /mnt/FogImages *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=0)
    /mnt/FogImages/images *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=1)
    /mnt/FogImages/images/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=2)
    

    The problem is when I perform exportfs -a, I am getting:

    “does not support NFS export”. Is it because I am using CIFS as the mount type? Anyway to bypass this so it reflects CIFS?

    I am still getting the error. Could someone let me know what else I need to check? I’m so close!

    Thank you all.

    ---- Update —

    So it seems after some dinner and a few hours of research, I found that Wayne-Workman and one other dev is also facing this issue back in 2013 and 20 days ago the new svn also broke this function? Is it safe to assume I am now going into uncharted territory and support thus will be slim to nil ?

    I am alternatively installing NFS on a server 2012 R2 box as a Windows Storage Node to get my imaging project moving forward. I would still like to know if it’s possible to get CIFS/SMB to work with FOG. Even though the two are quite vastly different than NFS.

    Thanks!


  • Moderator

    @koshia The mods and developers here have been testing imaging using Samba (work in progress). So far, we haven’t noticed any performance hits.

    However, we were running Samba directly on the FOG servers so the workflow would be:
    Fog Server -> Switch -> Host.

    You’re workflow wouldn’t be like that, as stated earlier. I think what you’re doing will be fine, just not as fast as it could be… by how much, I can’t say… just gotta set it up and see.



  • @Wayne-Workman said:

    @koshia said:

    @Wayne-Workman - I don’t know why you like Drobos… they’re POS. I’m just stuck with them because I already purchased it, haha. Either way, to answer your question:

    1. It would be easier; however, i’m using the drobo for multiple purposes. Mostly as windows shares to host software and back up windows server images and a few other minor things.
    2. I want to be able to learn how to properly mount and load a Windows share to Fog as in the future, I may end up moving fog to a different storage node (on windows) when it proves its usefulness on our network.

    In such case, I would still recommend throwing out FreeNFS, and just making a standard windows share, and then mounting that share within the FOG server via /etc/fstab

    I’d call the share simply “images”, and then mount on the Fedora box first (to /images) and THEN install FOG. After that, everything should be fine.

    Again, you’re going to see MAJOR performance hits simply due to the structure in which you’re setting this up.

    Thanks Wayne-Workman. I was actually looking into CIFS, wasn’t sure if NFS was better so I thought I had better stick with NFS. I’ll give it a go with CIFS as I have had luck with that working before. Let me know if there are any drawback, other than the workflow that you had stated earlier.

    Thanks!


  • Moderator

    @koshia said:

    @Wayne-Workman - I don’t know why you like Drobos… they’re POS. I’m just stuck with them because I already purchased it, haha. Either way, to answer your question:

    1. It would be easier; however, i’m using the drobo for multiple purposes. Mostly as windows shares to host software and back up windows server images and a few other minor things.
    2. I want to be able to learn how to properly mount and load a Windows share to Fog as in the future, I may end up moving fog to a different storage node (on windows) when it proves its usefulness on our network.

    In such case, I would still recommend throwing out FreeNFS, and just making a standard windows share, and then mounting that share within the FOG server via /etc/fstab

    I’d call the share simply “images”, and then mount on the Fedora box first (to /images) and THEN install FOG. After that, everything should be fine.

    Again, you’re going to see MAJOR performance hits simply due to the structure in which you’re setting this up.



  • @Wayne-Workman - I don’t know why you like Drobos… they’re POS. I’m just stuck with them because I already purchased it, haha. Either way, to answer your question:

    1. It would be easier; however, i’m using the drobo for multiple purposes. Mostly as windows shares to host software and back up windows server images and a few other minor things.
    2. I want to be able to learn how to properly mount and load a Windows share to Fog as in the future, I may end up moving fog to a different storage node (on windows) when it proves its usefulness on our network.

  • Moderator

    I have an idea that I’ll get to in a moment… but I wanted to explain what’s happening with how you’re wanting to set this up.

    You’re sharing an NFS directory on a drobo, on another machine.

    you’re mounting that directory locally into the FOG server,

    and then you’re re-exporting from the FOG server out to your hosts for imaging.

    So, the data flow is:

    Drobo -> Win7 -> Switch -> FOG -> Switch -> Host.

    And, if you’re ok with that,

    I say just throw out all the FreeNFS stuff, just make it a normal windows shared folder.
    Then mount that directory to FOG via CIFS (see the “Fedora 21 Server” wiki article). Then you can export that and it’d work just the same.

    And don’t quote me but I think you wouldn’t need FTP on the Win7 machine, since the FTP connection would be coming to the FOG server which has these directories locally mounted.

    However, I’d like to explain how storage nodes work (using the FOG installer).

    You build a linux machine, install FOG as storage node.

    You set that storage node’s settings into FOG web UI.

    Then, the flow of data is this:

    Storage node -> switch -> host.

    As you can imagine, this model is much faster.


  • Moderator

    @koshia

    I like Drobos a lot, I have one at work and it’s great. But a drive in it did bite the dust a few days ago… took like 36 hours for it to rebuild after I replaced the drive… but… .anyways…

    Is there a special reason why you’re using Windows for this?

    If you connected your Drobo to a linux machine, you could use the FOG installer to install FOG on the machine as a storage node and after a few simple copy / pastes of credentials into your FOG web UI, everything is working.

    In fact, why not just connect the Drobo to the main FOG server?



  • @Wayne-Workman I plan on using an external Drobo that’s USB connected to a Windows 7 Pro machine running FreeNFS.

    Per your suggestion:

    • I have deleted the entries for the default Fog server image storage locations. My /etc/exports:
      /mnt/FogImages *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=0
      /mnt/FogImages/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=1
    • Have not changed anything in fstab
    • Checked on permissions of the Windows Computer Share/Folder - only anonymous logon and everyone is in there with full control as access.
    • Tried systemctl nfs service restart, but it failed… looked up the journal/log - says: failed to stat /mnt/FogImages/dev - i’d imagine this is normal since I dont have it mounted correctly yet.

    I’m still getting :mount.nfs: access denied by server while mounting xxx.xxx.xxx.xxx:/FogImages.

    I don’t have FTP settings up and running yet - I will once I have the first part (mounting) to work first.


  • Moderator

    Very interesting endeavor.

    Do you plan to store images locally on your FOG server at all? If not, you can eleminate the first two lines in the /etc/exports bit you posted.

    And, to use the Windows NFS, you’ll need another line, one for /mnt/FogImanges/dev and it should be rw (read write).

    Speaking of which, I don’t know why the existing exports line for /images/dev is read only… that’d definitely break uploads.

    On your windows server, on the /FogImages directory, please allow the “everyone” group full access inside the security tab. Then, you need to figure out where the NFS permissions go for that program (I have absolutely no clue) and you need to set that to “everyone” as well. later after you get it going, you can tighten up security; But for now, it just needs to work.

    Also, you should be aware that any change inside the /etc/exports file will require either a server reboot, or restarting NFS. You can restart NFS like this:

    [CODE]systemctl restart nfs-server[/CODE]

    You will also need to setup FTP on the windows box, because FOG uses FTP for image management. You’ll need to set the root directory of FTP to the /mnt/FogImages directory, and you’ll need to allow full access to the “fog” user. Set a password for a user called fog, then put those credentials into your FOG server’s storage node, and in FOG Config -> Fog Settings -> Storage node.


Log in to reply
 

352
Online

39.3k
Users

11.0k
Topics

104.4k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.