ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Linux Lab Project: Building a Simple Linux NFS Server

    IT Discussion
    projects ntg lab storage centos 7 centos file server linux scale hc3 nas nfs server unix scale
    5
    7
    4.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by scottalanmiller

      A very common task with Linux, or any UNIX server, is building an NFS File Server (or NAS, as many people would call it.) NFS is the most common network file protocol in the UNIX world and is cross-platform, easy to use and very efficient.

      For this project, to keep things simple, I'm just going to build a basic CentOS 7 server with 100GB of storage on XFS on LVM, which gives me a highly robust, high performance, very scalable filesystem with snapshot and other features.

      This is purely a lab system to be blown away later, so I can share all details.

      NFS Fileserver on Scale HC3

      Just a single vCPU, 2GB RAM and the system is named "SAM-UserNAS". Very simple but this will provide us with a solid file server for our needs.

      Our disk setup is pretty simple, during installation I make a single 84GB logical volume to be mounted on /data that will house our file server data.

      Data Volume on CentOS 7 Install

      We can start by prepping the packages on the server:

      yum -y update
      yum -y install nfs-utils
      

      Then we can configure the NFS services:

      systemctl enable rpcbind
      systemctl enable nfs-server
      systemctl start rpcbind
      

      Now we will set up the file space:

      mkdir /data/users
      chmod 777 /data/users
      

      We need to, of course, open the system firewall to allow NFS traffic to pass to the server.

      firewall-cmd --permanent --zone=public --add-service=nfs
      firewall-cmd --reload
      

      The configuration of our NFS file server is help in the /etc/exports file. We can edit this to include the directory that we want to share:

      vi /etc/exports
      

      And we will add this line. The IP range in question is the internal LAN for this example:

      /data/users    10.100.42.0/24(rw,sync,no_root_squash,no_all_squash)
      

      After we set up the share we can start the service now that it has something to do.

      systemctl start nfs-server
      

      And there we go, we have an NFS share already available from our new NFS file server.

      1 Reply Last reply Reply Quote 12
      • DustinB3403D
        DustinB3403
        last edited by

        Very nice topic.

        Out of curiosity, what host and application are you using to build this VM?

        scottalanmillerS 1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch
          last edited by

          @DustinB3403 said:

          Out of curiosity, what host and application are you using to build this VM?

          I have never seen screens like that, so my first guess would be XenServer, because I have not set it up yet. But since you asked, now I assume a third party tool?

          1 Reply Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403
            last edited by

            Yeah that doesn't look line Xen at all, unless he has a 3rd party Xen Management tool from which he's doing this.

            1 Reply Last reply Reply Quote 0
            • stacksofplatesS
              stacksofplates
              last edited by

              Could be XenOrchestra. Their web interface is kind of similar.

              1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @DustinB3403
                last edited by

                @DustinB3403 said:

                Very nice topic.

                Out of curiosity, what host and application are you using to build this VM?

                That's a Scale HC3.

                1 Reply Last reply Reply Quote 2
                • dafyreD
                  dafyre
                  last edited by

                  I thought that screen looked familiar, lol.

                  1 Reply Last reply Reply Quote 1
                  • 1 / 1
                  • First post
                    Last post