LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 09-22-2004, 05:17 PM   #1
parv
Member
 
Registered: Jul 2004
Location: USA
Distribution: Mint, Scientifc Linux, Ubuntu
Posts: 180

Rep: Reputation: 30
want to mount a remote unix-based file system to fc2, nfs the answer? how?


i want to mount a unix-based file system to my fc2 as a local directory for read/write.
i guess i should use nfs, right? maybe i could also use samba, which one is better?
my question is: what shall I do to configure this on the unix server side?
i am only a common user in the unix system.

have read some nfs configuration documents but did not find the answer.
i'm sorry that i may not have searched the web extensively for the solution.

thanks.
 
Old 09-22-2004, 10:02 PM   #2
Kristijan
Member
 
Registered: Sep 2003
Location: Melbourne, Australia
Distribution: NetBSD 3.0.1, Slackware 10.1
Posts: 394

Rep: Reputation: 30
I set this up the other night, but I'm not confident to explain it to you off the top of my head. I am at work right now, and if there isnt a reply before I get home, ill type one up

-Kristijan
 
Old 09-23-2004, 03:04 AM   #3
Kristijan
Member
 
Registered: Sep 2003
Location: Melbourne, Australia
Distribution: NetBSD 3.0.1, Slackware 10.1
Posts: 394

Rep: Reputation: 30
I followed http://www.linuxworld.com.au/index.p...5;fp;2;fpid;37

Setting up an NFS share

Alastair Cousins, PC World

10/09/2004 08:13:19

FNS (Network File System) is a protocol used by UNIX/Linux computers to share disks across a network. Similar to the Common Internet File Services (CIFS) protocol used by Windows, NFS is older and more light-weight, and performs much more efficiently on UNIX and Linux systems. This month I’ll be showing you how to share a directory on a Linux server using NFS, and how to mount the directory on a Linux client.

Setting up an NFS share

As an example, we’ll be sharing the /home directory with all clients on a network. Sharing /home is a good idea if you’re running the Network Information Service (NIS) server that I covered in the May issue, as it allows you to use the same desktop and configuration settings on every computer attached to your network.

First, open /etc/exports as root using your favourite text editor. If this file doesn’t exist you will need to create it. Add the following to the file:

/home 192.168.1.0/255.255.255.0(rw)

This line shares the /home directory with all machines on the 192.168.1.0 network and allows each machine to have both read and write access to the share. Change this network address to one that is appropriate for your network. Read only access can be specified by changing (rw) to (ro).

You can individually specify a list of machines that will have access to the share, and tailor the access each machine has to the share, using a line such as:

/home 192.168.1.2(rw) 192.168.1.3(ro)

In this example, 192.168.1.2 has both read and write access to the share while 192.168.1.3 has only read access. Any other machine on your network will be unable to mount the share.

The method used to start the NFS server will depend on your distribution. Under most distributions, e.g. Red Hat Linux, you can start the NFS server by typing in a shell as root:

$ /etc/init.d/nfs start

This script may have a slightly different name in your distribution. For more detailed instructions on setting up a Linux NFS server, see the NFS HOWTO: http://nfs.sourceforge.net/nfs-howto/server.html

Mounting an NFS share

NFS shares are mounted like a local hard disk, using the mount command. To mount an NFS share you will need to know the hostname or IP of the NFS server and the directory on the server in which the NFS share is located. To mount this shared /home directory, type the following in a shell as root:

$ mount -t nfs 192.168.1.1:/home /home

This command mounts the directory /home stored on the computer at the IP 192.168.1.1 under /home on the local computer. NFS shares can be added to /etc/fstab as with any normal drive. Shares in /etc/fstab are mounted upon boot. This is useful for the /home directory, as it will be needed whenever a user logs in to the computer. An example entry for /home would be:

192.168.1.1:/home /home nfs rw,bg,hard,intr 0 0

This line background mounts the /home directory, so if the NFS server is not available upon boot your computer will not lock up while trying to mount the share.

Problems with NFS

If the connection between a client and an NFS server is broken, serious problems can occur. For example, when the NFS server is turned off, you may encounter complete lock-ups in a terminal and any applications accessing data stored on an NFS share. This is because the NFS protocol is very bad at identifying a connection drop-out and it waits to reconnect to the NFS server, rather than eventually giving up.

The solution to this problem is simple, but inconvenient. Whenever you break a connection between an NFS client and server, be sure to unmount any NFS shares from all the clients, ideally before the connection is broken. If you forget to do this and the connection between the NFS client and server is re-established, be sure to unmount and remount the shares on each client machine. If you don’t remount your NFS shares, you may experience errors when reading from the NFS server. You can unmount a share by typing in a shell as root:

$ umount <mount point of share>

NFS does not include any support for user authentication to access shares. It does, however, support the UNIX/Linux permissions system. When NFS is used in conjunction with an NIS server, it is easy to restrict the access each user has to directories on NFS shares using the same permissions you would on a local hard disk.

NFS includes no user authentication, so it’s best used to share system folders, such as /home and directories storing data that applications on your network may need. The Linux implementation of NFS is very good, and with suitable hardware is capable of serving hundreds of client machines. For more information on NFS under Linux, see http://nfs.sourceforge.net.


-Kristijan
 
Old 09-23-2004, 12:28 PM   #4
parv
Member
 
Registered: Jul 2004
Location: USA
Distribution: Mint, Scientifc Linux, Ubuntu
Posts: 180

Original Poster
Rep: Reputation: 30
thanks for your reply.
i followed the instruction and what i did in my fc2 system as root was:
edit /etc/exports:
/home/my-non-root-login-name IP-of-unix-machine/255.255.254.0(rw)
i stopped portmap, nfslock, and nfs, then restarted in the order: portmap->nfslock->nfs

i did nothing in the unix machine end. finally, i mounted the remote directory:
mount -t nfs IP-of-unix-machine:/home/my-non-root-login-name /mnt/remote

there was no error message, but when i enter /mnt/home i found i had only "x" access to
this directory. and i am curious why i was not asked for a password.

what have i missed?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS server - client cannot mount remote file system mikemrh9 Linux - Networking 6 10-12-2006 11:05 PM
Can't unmount NFS. Remote NFS system was down. PeteRossi Linux - Software 3 10-05-2003 02:23 PM
How can I nfs mount an NTFS file system on my linux server jj4broder Linux - Networking 4 09-30-2003 02:03 PM
How do I mount remote vfat partition with nfs x9abm Linux - Networking 10 08-29-2003 03:26 AM
A mounted file system inside an NFS mount paradoxlight Linux - Networking 1 04-24-2002 08:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 06:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration