Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a NAT drive, that is accessible via SMB. I have an entry in fstab to mount it at boot. But if the drive is not switched on it is not mounted during boot and I have to manually mount later. (The NAT boots a lot slower than my PC and usually is not up at the point PC tries to mount it).

Is there a way to automatically mount the drive when it becomes available in the network? Preferably if it can be done via command line tools, not involving GUI programs.

Using PCLinuxOS with KDE.

share|improve this question
I'm presuming that you have a NAS drive. – Kevin M Aug 21 '10 at 12:32

What you're looking for is AutoFS. Install the RPM, then make sure that it's running at start(RH/etc: chkconfig autofs on). Edit the file /etc/auto.master and add the following line: /media/ /etc/auto.media. If I were you, I would change "media" in both places to be the name of your root-level directory. Then edit the file /etc/auto.media and add finaldirname mount-options \\\sharename

A quick google gives this page.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.