Tuesday 24 February 2009

Sharing ubuntu directories.

Mostly from http://www.redhat.com/docs/manuals/linux/RHL-7-Manual/ref-guide/s1-sysadmin-nfs.html

and (better)

http://www.ubuntugeek.com/nfs-server-and-client-configuration-in-ubuntu.html


aptitude install nfs yielded:

Couldn't find package "nfs". However, the following
packages contain "nfs" in their name:
libyanfs-java nfsbooted libroxen-tokenfs p3nfs libnfsidmap-dev
fai-nfsroot libfile-nfslock-perl nfs-server unionfs-source funionfs
nfs-kernel-server unionfs-tools nfs-client libnfsidmap2 nfs-user-server
nfsboot nfs-common unfs3 knfs

So, I reckon nfs-server, nfs-client are probably required.

sudo apt-get install nfs-server nfs-client

shows:

Package nfs-server is a virtual package provided by:
nfs-kernel-server 1:1.1.2-2ubuntu2.2
unfs3 0.9.19+dfsg-1
nfs-user-server 2.2beta47-23
You should explicitly select one to install.

So, maybe nfs-kernel-server

sudo apt-get install nfs-kernel-server

Well, /etc/exports now exists; a good sign.

/mnt/sda2 192.168.1.108

is added. /mnt/sda2 is the shared folder. 192.168.1.108 is the machine allowed to connect.

After changes, either stop and start the daemon:

/etc/rc.d/init.d/nfs stop
/etc/rc.d/init.d/nfs start


or restart it:

/etc/rc.d/init.d/nfs restart

These didn't exist. More searching showed:

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

(already there)

sudo dpkg-reconfigure portmap (select no)

Restart portmap:

sudo /etc/init.d/portmap restart

Restart NFS:
sudo /etc/init.d/nfs-kernel-server restart

worked.


===========================

Install the client:

sudo apt-get install portmap nfs-common

===========================

Manual mount:

cd ~
sudo mount 192.168.1.65:/mnt/lin2/projects projects


===========================
Alternative method:
http://fuse.sourceforge.net/sshfs.html

Use ssh! Install fuse, and glib2.0-devel. Download from the link and ./configure; make; sudo make install

Then,

sshfs login@ipaddress:/path mountpoint

wow! Useful, particularly with firewall avoidance.

No comments:

Post a Comment