Weblog entry #1 for colabus

Messing with network file shares
Posted by colabus on Fri 8 Sep 2006 at 16:04
Tags: none.

Preface

I decided to mess with network file shares (NFS) for the first time today - yes maybe I'm a little behind :)

Anyhow, thought I'd share my experience with it. I've only done 20 minutes of reading but hopefully this might help someone at some point.

Begin

Background

NFS was originally written for UNIX but as with many cool tools has been ported to Linux. NFS enables users to connect to a remote server and mount shares from that box into the client’s file system - hence 'network'.

Installing

You'll obviously need to install it first

# sudo apt-get install nfs-kernel-server nfs-common portmap

If you were to only access shares, not run the shares (server), then don't install the "nfs-kernel-server" package.

Setup a basic share

We need to edit the "/etc/exports" file to do this.

Here's an example of what mine looks like:

colabus@typhon:~# egrep -v '#|^ *$' /etc/exports
/home/colabus/                      XXX.XX.XX.XXX/29(ro,sync)

There's obviously a heap of flags you can apply, I've included some below:

rw - This enables clients to both read and write requests on this NFS volume. The default I believe is read-only (ro).

ro - read-only access.

secure - Set by default, this option requires that requests originate on an Internet port less than 1,024.

sync/usync - pre-emptive responses to requests. Faster operation but will cause issues with the server crashes.

# man exports

Now that's configured and saved, apply the changes:

# sudo /usr/sbin/exportfs -r

I actually was rebooting this with the init script, but the above command does the same thing.

Mount on client PC

# sudo mount XXX.XX.XX.XXX:/home/colabus

Perhaps you'd like this automatically mounted.. if so just append in "/etc/fstab"

# Network Linux Shares
XXX.XX.XX.XXX:/home/colabus     /home/colabus/@TYPHON nfs   nfsvers=3,ro  0     0

Done!

There's obviously a lot more power to this but for 20 minutes looking into it I've found it quite dandy

 

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search