2

I have a .bat script that runs from a Windows 7 machine. Part of the script is to use plink to ssh into a Red Hat machine and run a couple commands. I have about 4 or 5 plink commands within the script. For example:

plink -pw password -ssh username@host "tar -czplf /archive/mounted_folder/test.tar /archive/folder_to_tar"

where mounted_folder is a mounted NFS share, which is located on a server running Windows Server 2008 R2.

I noticed that if the system hasn't been touched in over a day and then the script is run, the mounted folders on the Red Hat machine dropout and become unusable. If you reset the Red Hat machine, the folders are properly mounted again, and if you run the script again, it works as expected -- nothing is dropped.

What exactly could be causing this problem?

Edit:

If I try to remount the folder directly after it drops out using

mount -a

the mounts still are unusable, even though no error is produced. I've found that a reboot is the only way to get them remounted

Franklin
  • 131
  • 3
  • How is `mounted_folder` mounted and with what options? Is it in `/etc/fstab` or is it automounted? Let's see the line from `/etc/fstab`. – Aaron Copley Mar 26 '13 at 18:46
  • I'm mounting it in `/etc/fstab`. Here is what the mount looks like `server:/win_archive/folder_to_mount /archive/mounted_folder nfs defaults 1 2` – Franklin Mar 26 '13 at 19:03
  • Try `mount -av` to get more information? Any thing in `/var/log/messages`? – Aaron Copley Mar 26 '13 at 20:02

1 Answers1

0

I don't know if this is part of the problem or not, but mounted file systems don't need fsck or dump.

The fifth field, (fs_freq), is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.

The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.

For a mounted filesystem, you should use the mount option _netdev. This tells the system that it needs to be mounted after the network is brought online. Otherwise, it might not mount at boot.

server:/win_archive/folder_to_mount /archive/mounted_folder nfs _netdev 0 0
Aaron Copley
  • 12,345
  • 5
  • 46
  • 67
  • This isn't the greatest answer since it might not be directly related to the problem, but it was way too much to leave as a comment. – Aaron Copley Mar 26 '13 at 20:00
  • I'll change my `fstab` as you mentioned, but I don't think this has much to do with the problem. The folders are mounted fine before the script is run. Isn't the `fstab` only ever looked at during boot or when you do a `mount -a`? – Franklin Mar 26 '13 at 20:31