Author Topic: Mounting NFS Directories  (Read 2044 times)

0 Members and 1 Guest are viewing this topic.

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Mounting NFS Directories
« on: January 31, 2006, 12:38:57 am »
I was having some problems doing this this week, but I think I've finally figured it out!  The music I'm listening to right now is proof!  I wrote a tutorial on how to do it if anyone's interested:

http://www.sidoh.org/~sidoh/procedures/mounting_nfs.txt :
Quote
This tutorial is written for Slackware 10.0 and above.

In order for two Linux computers to communicate with eachother (file exchange), a
technology called NFS (Network Filesystem) is often used.  To my knowledge,
Slackware is not installed (by default) with the ability to use this technology.
To enable it, follow these steps:

I will use two machines named deepthought and muaddib in this example.
deepthought is the server, sharing files on its local drives; muaddib is
accessing these files through the mounting of an NFS drive.

First, you'll need to change user to root on both machines:

sidoh@deepthought:~$ su root
password:
root@deepthought:/home/sidoh#

--

sidoh@muaddib:~$ su root
password:
root@muaddib:/home/sidoh#

Next, we need to set up the /etc/hosts.allow and /etc/hosts.deny files on
both machines.  To use this, open your favorite text editor and change it to
look something like this on both machines:

/etc/hosts.allow --

nfsd: LOCAL
portmap: LOCAL

This will allow anything on the local network to make use of the NFS and
portmap daemons, both of which are needed to mount a NFS directory.

In order for the NFS daemon to run, you have to have entries in the
/etc/exports file for both computers.  Just make a dummy entry on the
computer you don't want to share anything on.  I'm not sure if there's a
way around that, but there might be! :)  On the server, type the path to
the directory you wish to share.

Now, we need to start the NFS and Portmap services on both computers.
Slackware has both of these daemons installed by default and has scripts
to start them in the /etc/rc.d directory.  As a note -- the portmap
service neets to be running BEFORE the nfs daemon is started.

To start them, do this:

root@deepthought:~# cd /etc/rc.d
root@deepthought:/etc/rc.d# ./rc.portmap start
root@deepthought:/etc/rc.d# ./rc.nfsd start

---

root@muaddib:~# cd /etc/rc.d
root@muaddib:/etc/rc.d# ./rc.portmap start
root@muaddib:/etc/rc.d# ./rc.nfsd start

This should start everything you need.  Now, you just need to mount the drive!

root@muaddib:~# mount -t nfs deepthought:/mnt/hdb1/share /mnt/share

Questions, comments, concerns?  E-mail: sidoh (at) dark-wire (dot) net

Works pretty well!

sidoh@muaddib:/mnt/media$ ls -l
total 2872
-rwxr-xr-x    1 sidoh 103  140096 2005-09-28 20:05 COMDLG32.OCX*
-rwxr-xr-x    1 sidoh 103   24576 2005-09-28 20:05 DirDlg2.ocx*
drwxr-xr-x    9 sidoh 103    4096 2005-09-28 20:05 Lyrics/
-rwxr-xr-x    1 sidoh 103 1077336 2005-09-28 20:05 MSCOMCTL.OCX*
drwxr-xr-x  141 sidoh 103    4096 2006-01-16 00:20 MUSIC/
-rwxr-xr-x    1 sidoh 103    9217 2005-09-28 20:24 MUSIC.TXT*
drwxr-xr-x    6 sidoh 103    4096 2006-01-27 01:00 Movies/
-rwxr-xr-x    1 sidoh 103  278528 2005-10-15 14:17 Music\ Manager.exe*
drwxr-xr-x   10 sidoh 103    4096 2005-09-28 20:26 Pictures\ from\ dad/
drwxr-xr-x    5 sidoh 103    4096 2005-09-28 20:27 Players/
drwxr-xr-x    4 sidoh 103    4096 2005-09-28 20:27 TV\ Shows/
drwxr-xr-x    3 sidoh 103    4096 2005-09-28 20:27 Upload/
-rwxr-xr-x    1 sidoh 103  581730 2005-09-28 20:27 mm1.9.14b.rar*
-rwxr-xr-x    1 sidoh 103  670009 2005-09-28 20:27 mm1.9.14b.zip*
-rwxr-xr-x    1 sidoh 103   85039 2005-09-28 20:27 settings.rar*
-rwxr-xr-x    1 sidoh 103     100 2005-10-02 17:04 settings.txt*

Offline Ergot

  • 吴立峰 ^_^ !
  • x86
  • Hero Member
  • *****
  • Posts: 3724
  • I steal bandwidth. p_o
    • View Profile
Re: Mounting NFS Directories
« Reply #1 on: January 31, 2006, 12:42:30 am »
Sharing /dev/null wouldn't be too bad :P ?
chmod +x the two files in /etc/rc.d/ to have them load at boot :)
Who gives a damn? I fuck sheep all the time.
And yes, male both ends.  There are a couple lesbians that need a two-ended dildo...My router just refuses to wear a strap-on.
(05:55:03) JoE ThE oDD: omfg good job i got a boner thinkin bout them chinese bitches
(17:54:15) Sidoh: I love cosmetology

Offline mynameistmp

  • Moderator
  • Full Member
  • *****
  • Posts: 111
  • Hi! I'm new here!
    • View Profile
Re: Mounting NFS Directories
« Reply #2 on: January 31, 2006, 03:34:14 am »
Good work. Should look at NIS+ for premission preservation.

PS
I'm pretty sure it's mauddib ;P

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Mounting NFS Directories
« Reply #3 on: January 31, 2006, 03:39:09 am »
Good work. Should look at NIS+ for premission preservation.

PS
I'm pretty sure it's mauddib ;P

What's NIS+? :)

You're pretty sure what's muaddib?  It's from Dune -- Muad'Dib; it's what Paul Atreides named himself among the Fremen.

Offline mynameistmp

  • Moderator
  • Full Member
  • *****
  • Posts: 111
  • Hi! I'm new here!
    • View Profile
Re: Mounting NFS Directories
« Reply #4 on: January 31, 2006, 03:54:53 am »
You're right. My bad.