• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Network drives in Linux...?

I'm using RH6.1. I'd like to map a drive(like in Windows) to another Linux machine on the network. What's the command to do this?
0
tibori
Asked:
tibori
  • 4
  • 3
  • 3
  • +2
1 Solution
 
j2Commented:
it's not a command, its a religion :)

anyway, its called NFS, consult your documentation.
0
 
tiboriAuthor Commented:
Ok, I got it. Reading the documentation always helps. For others with the same question the command was:
mount -t nfs server:/dir/dir/

 Now is how can I make a symbolic link to it in KDE? I'd like it to be just like the "file system device" for CDroms and such, so that by clicking on it it'll mount it.
0
 
j2Commented:
Thats trickier, that would involve using some kind of automout daemon.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
bernardhCommented:
you can include it in your /etc/fstab file so you can view the directories from kde file manager.
0
 
j2Commented:
Ah of cource.. but i didnt think he wated a static mount since he said "clicking on it it'll mount it." But that would work.
0
 
snoopy00Commented:
Don't bother with NFS.  I can't think of any reason why you would need it, but I'm sure there are situations that might merit it.  Use Samba.

Type: Samba Start

If it starts successfully you will know because it will say smb [ok], nmb [ok].

If it does, you use smbmount to mount any Windows drive on your network like this:

smbmount //(computer)/(mydrive) /mnt/(mountpoint) -U (userid)

then it will ask you for your password to the NT Domain or Windows workstation.

(computer) can be a name of a computer if the name and ip address are listed in the /etc/hosts file.  If not just use the static ip address e.g. '192.168.0.0' (you are using tcpip on your network yes? -- if the drive is a dos drive on the same machine there is an entirely different procedure to do this using the mount command.)

this should all work like a charm..if you have any trouble just post again and we'll debug it.
0
 
snoopy00Commented:
Note:  I forgot to include this in my answer--

If you don't know about mount points they are easy to set up.

All you need to do is make a directory in /mnt (or anywhere) like this:

mkdir /mnt/mymountpoint

0
 
tiboriAuthor Commented:
snoopy: I'm a little confused by your comment. What I'm trying to do is map a drive that exists on the file server (linux machine) onto a LINUX machine. We do have windows clients running and we ARE using samba, but only for the windows clients. Are you saying that it is possible to map a samba share onto a linux machine? If yes then what would be the advantage of doing so over nfs?
I was able to accomplish it by using NFS, however I don't necessarily want to mount these drives upon startup. I'd rather have an icon on my desktop that mounts it when I click on it. I'm currently using this feature for my CDROm and floppy, but those are physical devices. Can I do the same for an NFS device?
0
 
snoopy00Commented:
tibori

I thought you said you wanted to mount Windows drives.  
0
 
tiboriAuthor Commented:
Sorry about that. It was a bit unclear.
0
 
jlevieCommented:
Automounts really aren't difficult to do, though I've never tried to make one "clickable" mount button. A better solution, in my opinion would be to use autofs on the client to mount directories on demand. It also unmounts after a period of inactivity (provided nothing has a lock on any of the automounted contents).

To set up the automounter you'll need to add the autofs package if it's not already installed and enable it as a system service. Then you can add a mount point to /etc/auto.master, typically pointing to another automounter map. I've got a number of NFS servers that I access and my auto.master file has a line that looks like:

/dist      /etc/auto.dist  --timeout 60

and auto.dist contains lines like:

chaos      chaos.dom.com:/nfs0/sources
chimera      chimera.dom.com:/nfs1/sources
sgi      goby.dom.com:/apps/data-sets

I've made an empty directory on my local system used as the base reference point, which allows me to access any of the remote resources as in "ls /dist/chaos" or "cp current /dist/sgi". I have very little use for file managers, but if you tell one to look at /dist/chimera, it'll obligingly show you the directory contents. I suppose you could set up a desktop folder pointed at one of the automount points also. (Does that qualify as clickable?)

One of the big advantages of this method vs a "clickable" mount is that it happens automagically. This means that you can have the path in a shell script, executable, or whatever, and when the path is referenced the remote resource gets mounted and used (and eventually unmounted). It doesn't depend on you having remembered to "click mount" it before use and it won't cause booting problems if the NFS server isn't available (providing you don't reference an automounted resource in one of the rc scripts).

Sun systems have been doing this sort of things for years to allow a user's home directory to reside on a central server and be automounted at login on any arbitrary workstation, and it works very, very well, thank you.
0
 
tiboriAuthor Commented:
jlevie: sounds like what I'm looking for!! Could you explain the format of the auto.dist file? Thanks,
0
 
jlevieCommented:
Ummm, I thought I did, but maybe I didn't make it apparent. Those lines shown above are in fact a "paste" of part of my auto.dist file. Each line is in essence a key-value pair, space or tab separated.  For example:

chaos      chaos.dom.com:/nfs0/sources

contains the mount point name "chaos", a tab character and the specification of the NFS export to be mounted.

What happens when I reference "/dist/chaos" is that autofs (which knows that it's managing the automount points under "/dist") looks at auto.master and gets the map name (auto.dist) and the NFS mount options. It the consults the "auto.dist" map and finds the "chaos" entry and performs the specified NFS mount.

If this isn't enough of an explanation, please let me know what I can do to help.
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 4
  • 3
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now