Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Automount

Posted on 1998-04-23
6
Medium Priority
?
489 Views
Last Modified: 2010-04-22
Now I gave 2 machines. and I use to mount the 2'nd macinne
using moung -t machine2:/ /net
Now I wounder what amd is. How it works and how to set this up.
Does automount mean that i can do so I have /net unmounted but it get mounted when I cd to the directory /net and It unmount the directory by it self???
0
Comment
Question by:hulken
  • 3
  • 3
6 Comments
 
LVL 2

Accepted Solution

by:
jaked earned 200 total points
ID: 1633641
amd will automatically mount an NFS partition when you try to access a file in a particular directory. It works pretty well.

Here's a generic config for automounting to /net:

/defaults fs:=${autodir}/${rhost}/root/${rfs};opts=nosuid,nodev
*       rhost:=${key};type:=host;rfs:=/

You want to start amd with "/net /etc/amd.conf" as arguments (assuming you have the above config in /etc/amd.conf).

With this setup, the pathname contains the hostname of the server you want to mount, and the name of the exported volume, such as

/net/ftp.kernel.org/home/ftp/pub

ftp.kernel.org is the server and /home/ftp/pub is the exported volume.

If you just want to mount a single machine and volume, try

kernel       type:=nfs;rhost:=ftp.kernel.org;rfs=:/home/ftp/pub

Alternatively, you could create another directory with symlinks, like kernel->/net/ftp.kernel.org/home/ftp/pub, for your frequently used volumes. This is kind of nice because you can just cd to the directory to mount the volume, instead of having to actually access a file.
0
 

Author Comment

by:hulken
ID: 1633642
I think I don't understand. But mabe it's because my english is so bad.
I run RedHat 5.0. and amd starts when I start my computer.
My /etc/amd.conf looks like this:

/defaults fs:=${autodir}/${rhost}/root/${rfs};opts=nosuid,nodev
*       rhost:=${key};type:=host;rfs:=/

Say that I like machine1.domain.se to mount / from machine2.domain.se under /net

What shall I edit???
If I understand you right I shall add
/net/machine2.domain.se/ somewhere is this right?
BTW. I like root on machine1 to have premission to write on machine2. How do I fix this?


0
 
LVL 2

Expert Comment

by:jaked
ID: 1633643
OK, if you already have amd set up, all you have to do is go to /net/machine2.domain.se and you should see the volume--you don't need to edit anything. Amd will mount the volume for you.

In order to map root on machine1 to root on machine2, you need to edit your /etc/exports and add no_root_squash to the options for the exported volume.

0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:hulken
ID: 1633644
Oh, thanks.. So it have been working all the time. It worked direct when I did a cd /net/machine2

I thougt I could get it to work like this:

if I did a cd /net
amd should mount machine 2 there. But mabe the best way to do this is with an alias.

I just wounder one thing more.
When I use amd. Do I nead to start the nfsfs on machine one???
Do I have to start nfs on machine one???
(/etc/rc.d/rc3.d/S60nfs and /etc/rc.d/rc3.d/S15nfsfs)
0
 
LVL 2

Expert Comment

by:jaked
ID: 1633645
No, you don't need those. The 'nfs' startup script starts nfsd, so you need it only on machine2. The 'nfsfs' script mounts all filesystems in your fstab with typ nfs, and since you're handling that through amd you don't need it either.

0
 

Author Comment

by:hulken
ID: 1633646
If you se this. I wounder one more thing. I have something  /etc/rc.d/init.d/autofs
What is this???
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month7 days, 3 hours left to enroll

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question