LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mount subdirectory from another Linux server (https://www.linuxquestions.org/questions/linux-newbie-8/mount-subdirectory-from-another-linux-server-205733/)

kiwi8 07-16-2004 03:30 AM

mount subdirectory from another Linux server
 
New to Linux. Just installed RedHat Linux on my server. How do I "map"/mount to a subdirectory from another RedHat Linux server?

pingu 07-16-2004 04:53 AM

On the server, edit /etc/exports.
(I'm taking this from my memory, can't check it right now)
Say you want to share /misc on server (IP 192.168.30.1) to anybody in 192.168.30.0, add a line like:
/misc 192.168.30.0/24(rw)
as root, run
#exportfs -a

On the mounting machine, mount as usual:
# mount 192.168.30.1:/misc /mnt/mymountpoint

kevinatkins 07-16-2004 05:50 AM

hi,

yes, to expand on pingu's post, you need to set up nfs - configure the server box as an nfs server, then mount the exported directory in the normal manner on your client machine.

i can't remember off the top of my head what the various steps are in configuring an nfs server - you may find that red hat includes a gui nfs configuration tool - suse certainly does in yast.

there are a number of tutorials out there - try searching this site, or google, for nfs configuration.

kiwi8 07-17-2004 11:18 PM

I've added an entry in /etc/exports on the server. Restarted nfs. Tried to mount and here's what I got:
mount: server:/subdir failed, reason given by server: Permission denied.

kevinatkins 07-18-2004 01:09 PM

hi,

you probably want to have a look at your /etc/hosts.allow and /etc/hosts.deny files...

kiwi8 07-18-2004 06:13 PM

There were no entries in either /etc/hosts.allow or /etc/hosts.deny

I added an entry in /etc/hosts.allow with the name of the server trying to mount the subdirectory. I restarted the nfs server. Still got the same "Permission denied" error.

Any suggestions? Thanks!

kiwi8 07-18-2004 06:33 PM

Finally got it working! My mistake, I had the wrong entry in /etc/exports file. I had the name of the server rather than the client. All's working now. Next challenge is to have the subdirectory mounted automatically so I don't have to manually do it each time after rebooting.


All times are GMT -5. The time now is 02:19 AM.