LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem mounting directory between servers (https://www.linuxquestions.org/questions/linux-newbie-8/problem-mounting-directory-between-servers-652102/)

ttsang123 06-27-2008 11:38 AM

Problem mounting directory between servers
 
Hi All,

I am having problem mounting a directory between two servers.

I have two servers both running rhel4 on the same subnet 192.168.1.10 and 192.168.1.2 and I am trying (and failing) to mount a directory from one to another.

I have tried the following:

>mount 192.168.1.10/var/www/html /root/www/
mount: special device 192.168.1.10/var/www/html does not exist

>mount 192.168.1.10:/var/www/html /root/www/
ount: mount to NFS server '192.168.1.10' failed: RPC Error: Program not registered.

>mount //192.168.1.10/var/www/html /root/www/
Password: <correct password inserted>
mount error 13 = Permission denied

>mount -o root //192.168.1.10/var/www/html /root/www/
Password: <correct password inserted>
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

>mount //192.168.1.10:/var/www/html /root/www/
mount: can't get address for //192.168.1.10

I have set full access on both directories.

I can ping each machine from the other.

I know I have missed something. Can anyone let me know what it is?

Thanks

T

onebuck 06-27-2008 12:13 PM

Hi,

You will need to setup your systems for a 'NFS' Network Filesystem. Look at 'Linux NFS' and 'Linux Networking HOWTO' to get some good online reference.

You should setup the following;

Code:

/etc/hosts    /etc/hosts.deny
/etc/hosts.allow

Code:

excerpt from 'man hosts'
HOSTS(5)                  Linux Programmer's Manual                  HOSTS(5)

NAME
      hosts - The static table lookup for host names

SYNOPSIS
      /etc/hosts

DESCRIPTION
      This  manual  page  describes  the format of the /etc/hosts file.  This
      file is a simple text file that associates IP addresses with hostnames,
      one line per IP address.  For each host a single line should be present
      with the following information:

              IP_address canonical_hostname [aliases...]

Code:

excerpt from 'man nfs';

NFS(5)                                                                  NFS(5)

NAME
      nfs - fstab format and options for the nfs and nfs4 file systems

SYNOPSIS
      /etc/fstab

DESCRIPTION
      NFS  is  an  Internet  Standard protocol created by Sun Microsystems in
      1984. NFS was developed to allow file sharing between systems  residing
      on  a local area network.  The Linux NFS client supports three versions
      of the NFS protocol: NFS version 2 [RFC1094], NFS version 3  [RFC1813],
      and NFS version 4 [RFC3530].

      The  mount(8) command attaches a file system to the system's name space
      hierarchy at a given mount point.  The /etc/fstab  file  describes  how
      mount(8)  should  assemble  a system's file name hierarchy from various
      independent file  systems  (including  file  systems  exported  by  NFS
      servers).  Each  line  in  the /etc/fstab file describes a single file
      system, its mount point, and a set of default mount  options  for  that
      mount point.
      For NFS file system mounts, a line in the /etc/fstab file specifies the
      server name, the path name of the exported server directory  to  mount,
      the  local  directory  that is the mount point, the type of file system
      that is being mounted, and a list of mount options that control the way
      the filesystem is mounted and how the NFS client behaves when accessing
      files on this mount point.  The fifth and sixth fields on each line are
      not  used  by NFS, thus conventionally each contain the digit zero. For
      example:

            server:path    /mountpoint    fstype    option,option,...  0 0

      The server's hostname and export pathname are  separated  by  a  colon,
      while  the  mount options are separated by commas. The remaining fields
      are separated by blanks or tabs.  The  server's  hostname  can  be  an
      unqualified  hostname,  a fully qualified domain name, or a dotted quad
      IPv4 address.  The fstype field contains either "nfs" (for version 2 or
      version  3  NFS  mounts) or "nfs4" (for NFS version 4 mounts).  The nfs
      and nfs4 file system types  share  similar  mount  options,  which  are
      described below.

Don't forget the '/etc/exports'.

Code:

excerpt from 'man exports';

EXPORTS(5)                Linux File Formats Manual                EXPORTS(5)

NAME
      exports - NFS file systems being exported (for Kernel based NFS)

SYNOPSIS
      /etc/exports

DESCRIPTION
      The  file  /etc/exports serves as the access control list for file sys-
      tems which may be exported to NFS clients.  It is used  by  exportfs(8)
      to  give  information  to  mountd(8)  and  to the kernel based NFS file
      server daemon nfsd(8).

      The file format is similar to the SunOS exports file.  Each  line  con-
      tains  an  export  point  and  a  whitespace-separated  list of clients
      allowed to mount the file system at that point. Each listed client  may
      be  immediately  followed  by  a parenthesized, comma-separated list of
      export options for that client. No whitespace is  permitted  between  a
      client and its option list.

Don't forget 'exportfs';

Code:

excerpt from 'man exportfs';

exportfs(8)                                                        exportfs(8)

NAME
      exportfs - maintain list of NFS exported file systems

SYNOPSIS
      /usr/sbin/exportfs [-avi] [-o options,..] [client:/path ..]
      /usr/sbin/exportfs -r [-v]
      /usr/sbin/exportfs [-av] -u [client:/path ..]
      /usr/sbin/exportfs [-v]
      /usr/sbin/exportfs -f

DESCRIPTION
      The  exportfs command is used to maintain the current table of exported
      file systems for NFS. This list  is  kept  in  a  separate  file  named
      /var/lib/nfs/xtab  which  is read by mountd when a remote host requests
      access to mount a file tree, and parts of the list which are active are
      kept in the kernel's export table.

      Normally  this  xtab file is initialized with the list of all file sys-
      tems named in /etc/exports by invoking exportfs -a.

This link and others are available from 'Slackware-Links'. More than just SlackwareŽ links!

Good luck!

ttsang123 06-27-2008 04:56 PM

Thanks for the info.

I will go through it and let everyone know how i get on.

Cheers!

onebuck 06-27-2008 05:48 PM

Hi,

Don't forget to make sure you have the daemons started and running . You will need the 'rpc' (RPC 'NFS' daemons).


All times are GMT -5. The time now is 01:38 PM.