0

We have a Linux system and several Windows system on our network. The Linux system has mounts on two different systems currently defined in fstab like this:

//mandi/aaronbackup /media/backup smbfs user=ServiceBarcode,passwd=******** 0 0

//laurie/barcodefiles /home/labels/public_html/masbarcode smbfs user=ServiceBarcode,passwd=************,uid=33,gid=33 0 0

The issue I am having is on power failures. The Linux system boots much faster than the Windows systems, so the Windows systems are unavailable when the Linux system tries to mount them. Is there a way to have Linux retry the mounts until they succeed with fstab or by another mechanism?

030
  • 5,901
  • 13
  • 68
  • 110

1 Answers1

0

This is a dirty hack but would work...

Create a shell script with this in it. Replace the staticfilename to something that always resides in the to be mounted Windows directory.

#!/bin/bash
if [ -f /home/labels/public_html/masbarcode/staticfilename ]; then
  exit 0
else
  mount -a
fi

and run it as a cron job every X minutes.

If the static file is unavailable then the Windows directory is unmounted and it will be mounted by running mount -a which will try to mount all unmounted points that are specified in fstab.

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
technick
  • 1
  • 1