Map network drives on restart

New to Debian (Or Linux in general)? Ask your questions here!

Map network drives on restart

Postby jbeeker » 2012-05-30 01:29

Hello, obviously I am new at this, and I have set up a machine running Debian as a media server in my house (frees up the PCs for the kids to mess up). The media collection is located on a NAS. I mount the network drives via fstab, and a reboot will remount the drives, so cool.

But here is the problem; the rare power outage brings down the Debian box and the NAS, but the Debian box boots faster, doesn’t find the NAS, and therefore doesn’t map the drives. A reboot will remount the drives, so everything works still.

I guess I can write a script to check for the NAS, and if not there wait and then check again, but there must me a simpler solution to this (besides buying a battery backup!).

Thanks, Jon
jbeeker
 
Posts: 1
Joined: 2012-05-30 01:18

Re: Map network drives on restart

Postby Aris Veresie » 2012-05-30 04:11

Instead of a reboot you could mount -a. A simple solution is to apply that command after a minute or two via a script (I think cron or anacron will do, but I do not know how to use those).
Being anonymous is the same as being an idiot.
Aris Veresie
 
Posts: 562
Joined: 2011-06-02 15:55
Location: Limassol, Cyprus

Re: Map network drives on restart

Postby admoore » 2012-05-30 04:12

I don't have much personal experience with it, but it sounds like autofs might be useful here. See http://wiki.debian.org/AutoFs
admoore
 
Posts: 94
Joined: 2010-05-17 14:29


Return to Beginners Questions

Who is online

Users browsing this forum: Odranoel and 9 guests

fashionable