LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-21-2011, 09:18 PM   #1
eamesj
Member
 
Registered: May 2006
Posts: 54

Rep: Reputation: 1
fstab/mtab hardmount a remote machine


Hi all,

I am trying to get a mount in my root directory to a folder on a remote machine so that a log in is not required to access it. I seem to be having some problems with permissions though.

So far I have:
- added the machine to my /etc/hosts file
- added remotemachine:/data /auto nfs ro,soft 0 0
to my /etc/fstab
- added remotemachine:/data /auto nfs rw,soft,addr=10.112.33.4 0 0 to my /etc/mtab file
- added /hostmachinefolder mymachineip(rw) to the host /etc/exports file

however when I mount -a on my machine i get
mount: remotemachine:/folder failed, reason given by server: Permission denied

Can anyone walk me through how to set this up?

Many thanks in advance
Jon
 
Old 04-22-2011, 12:56 AM   #2
brian-va
Member
 
Registered: Dec 2009
Distribution: Debian
Posts: 46

Rep: Reputation: Disabled
try using a credentials file
 
Old 04-22-2011, 03:15 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Sorry, I can't help you with your problem, I just want to note that /etc/mtab is not a configuration file and therefore editing this file has absolutely no consequences to your system.
 
Old 04-22-2011, 05:35 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Concur entirely. Mount handles that for you.

With nfs could be permissions on the exported folder, or could be portmap/rcpbind ports that need to be puched in the firewall(s). nfs4 makes this much easier. Prior to nfs4 I think the ports are dynamic (i.e. change all the bloody time) by default. What a stupid design.
Hit google.

Last edited by syg00; 04-22-2011 at 05:36 AM.
 
Old 05-01-2011, 08:48 AM   #5
eamesj
Member
 
Registered: May 2006
Posts: 54

Original Poster
Rep: Reputation: 1
Thanks for the replies,

My solution:
1. Create the directory on the local machine to link to

2. Add remote machine ip to /etc/hosts file
ip.ip.ip.ip host

3. Add host to /etc/fstab
host:/dir /local/dir nfs ro,soft 0 0

4. I could only get this working by editing the mtab as well.. don't know why if someone could explain this itd be nice.
host:/dir /local/dir nfs ro,soft,addr=10.112.33.4 0 0

5. Add local machine to host /etc/hosts file
ip.ip.ip.ip localname localname

6. Edit the /etc/exports to include the local ip
/hostname localname(ro)

7. Export the hosts filesystem
hostmachine#exportfs

8. Create mount to host
mount -t nfs -v ip.ip.ip.ip:hostdir /local/dir

9. Mount
localmachine# mount -a

Sweet!
 
  


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
server startup error: "cannot find / in /etc/fstab or /etc/mtab"; /etc/fstab readonly knee-co Linux - Newbie 8 09-12-2010 05:37 PM
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 06:15 AM
/etc/fstab or /etc/mtab praveenv Linux - Newbie 1 08-17-2004 04:03 AM
use mtab as fstab?hi rgiggs Mandriva 5 06-08-2004 12:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:24 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