Setup NFS Server On FreeBSD
Network File System(NFS) is a network file system protocol developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a network on other networked Computer.
1. Setting up a FreeBSD NFS Server
In this how-to my testbox is running with FreeBSD with IP Address 192.168.1.117.
The first step to setting up a NFS server is to edit the /etc/rc.conf file and add the following lines:
nfs_server_enable="YES" nfs_server_flags="-u -t -n 4" rpcbind_enable="YES" mountd_flags="-r" mountd_enable="YES"
Next, you have to set up /etc/exports file to define which machines have permission to which folders.
/data1 -maproot=user1 host1 host2 host3 /data2 -alldirs host1 host2 host3 /data3 host2
In the above example,
The user1 of host1, host2 and host3 systems has been given privileges to the /data1 directory.
The /data2 and its sub-directories has been given read access to host1, host2 and host3 systems.
The /data3 has been read access to host2 system(make sure you replace hosts with your desired host names).
To start NFS on FreeBSD server, do:
1 rpcbind 2 nfsd -u -t -n 4 3 mountd -r
2. Restarting the NFS Server
Once you have made changes to the exports file you need to restart NFS for the changes to take effect:
1 kill -HUP `cat /var/run/mountd.pid`
3. Setup the FreeBSD NFS Client
You need to add the following lines to /etc/rc.conf.
nfs_client_enable="YES" nfs_client_flags="-n 4" rpc_lockd_enable="YES" rpc_statd_enable="YES"
4. Mounting NFS Shares
Mounting can be done like below:
# mount_nfs IP:/data1 /data1
5. Auto Mounting NFS Shares
NFS shares can be automatically mounted by editing /etc/fstab file.
server:/data1 /data1 nfs rw 2 2
6. Mount FreeBSD NFS Shares On Centos Clients
Install Some NFS tools and Libraries:
# yum install nfs-utils nfs-utils-lib
Mount and list the remote folder.
# mount -t nfs FreBSD-Unixmen:/data1 -o vers=3 /NFS # ls /NFS/ testx testy testz
Like us on Facebook
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Manage Databases And Hosted Servers Remotely With DbNinja : Database administration via command line is bit difficult for newbie system and database administrat...0 comments |
- How To Install Linux Kernel 3.12.4 In Ubuntu : Linux Kernel 3.12.4 has been officially released with fixes for inet6_init() cleanup order, seqlock ...0 comments |
- Install Sayonara Player In Elementary OS / Ubuntu / Linux Mint : Sayonara is a small, clear and fast audio player for Linux written in C++, supported by the Qt frame...0 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Firefox 26 Has Been Released, How To Install It In Ubuntu And Its Derivates : Hi guys, Firefox 26 has been released for Windows, Mac OS X, Linux and Android devices. It brings m...0 comments |
- Setup Secure FTP Server With MySecureShell
- How To Install Linux Kernel 3.12.4 In Ubuntu
- Firefox 26 Has Been Released, How To Install It In Ubuntu And Its Derivates
- How To Install Brasero In Elementary OS ‘Luna’
- Install Sayonara Player In Elementary OS / Ubuntu / Linux Mint
- Manage Databases And Hosted Servers Remotely With DbNinja
- Install FrostWire 5.6.9 In Elementary OS ‘Luna’/ Ubuntu / Linux Mint
- Setup IT And Asset Management System With GLPI On Debian/Ubuntu
- How To Configure Linux Clients To Authenticate Using OpenLDAP
- How To Install Netflix In Ubuntu
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .