Difference between revisions of "Setting up NFS for file sharing"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
(Created page with "Setting up NFS")
 
Line 1: Line 1:
Setting up NFS
{{{!}} class="wikitable" style="float: right; width: 322px;" border="2"
{{!}}+ Proven on:
{{!}}- --="" debian=""
{{!}} style="text-align: center; width: 60px;" {{!}} [[File:Logo Debian.png{{!}}60px{{!}}link=https://www.debian.org/{{!}}center{{!}}middle{{!}}frameless]]
{{!}} style="text-align: center; width: 40px;" {{!}} 11 (bullseye)
{{!}}
 
<br>
{{!}}}
 
==Install NFS Server==
 
* <code>sudo apt install nfs-kernel-server</code>
 
==Configure NFS Server==
 
* <code>sudo vi /etc/exports</code>
 
Add/edit:
 
'''/path/to/be/shared''' *(rw,async,no_root_squash,no_subtree_check)
 
For the changes to take effect, export and start NFS service.
* <code>sudo exportfs -a</code>
* <code>sudo /etc/init.d/nfs-kernel-server start</code>
 
Pretty simple...
 
==Connecting to the NFS Server==
You'll need NFS installed
* <code>sudo apt install nfs-common</code>
 
or
* <code>sudo apt install nfs-kernel-server</code>
 
Then you can check what's shared from any particular machine:
* <code>showmount -e '''[ServerName or Address]'''</code>
** (requires sudo on Debian...)
 
will show you what's shared from a machine
 
===Setting up & mounting a share===
 
* <code>sudo mkdir -p '''/path/to/mount/share'''</code>
* <code>sudo mount '''[ServerName or Address]''':'''/path/to/be/shared''' '''/path/to/mount/share'''</code>
Better yet tho...
* <code>sudo vi /etc/fstab</code>
& add an entry:
'''[ServerName or Address]''':'''/path/to/be/shared''' '''/path/to/mount/share''' nfs rw,user,exec 0 0
 
==TBD==
 
* Learn what flags do what in '''/etc/exports'''
* Browsing in the GUI would be nice...
* Look into automounting (including graceful failure modes)
 
==Some Links==
 
* [https://www.cyberciti.biz/faq/how-to-ubuntu-nfs-server-configuration-howto/ Ubuntu Linux NFS Server installation and Configuration]
 
[[Category:Linux]]
[[Category: WIP]]

Revision as of 02:40, 19 May 2022

Proven on:
Logo Debian.png
11 (bullseye)


Install NFS Server

  • sudo apt install nfs-kernel-server

Configure NFS Server

  • sudo vi /etc/exports

Add/edit:

/path/to/be/shared *(rw,async,no_root_squash,no_subtree_check)

For the changes to take effect, export and start NFS service.

  • sudo exportfs -a
  • sudo /etc/init.d/nfs-kernel-server start

Pretty simple...

Connecting to the NFS Server

You'll need NFS installed

  • sudo apt install nfs-common

or

  • sudo apt install nfs-kernel-server

Then you can check what's shared from any particular machine:

  • showmount -e [ServerName or Address]
    • (requires sudo on Debian...)

will show you what's shared from a machine

Setting up & mounting a share

  • sudo mkdir -p /path/to/mount/share
  • sudo mount [ServerName or Address]:/path/to/be/shared /path/to/mount/share

Better yet tho...

  • sudo vi /etc/fstab

& add an entry:

[ServerName or Address]:/path/to/be/shared /path/to/mount/share nfs rw,user,exec 0 0

TBD

  • Learn what flags do what in /etc/exports
  • Browsing in the GUI would be nice...
  • Look into automounting (including graceful failure modes)

Some Links