Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 10054  / 1 Year ago, sun, april 2, 2023, 6:21:23

I have a machine that mounts another machine's NFS share.



However the client machine boots up faster than the server, so it gets an error when trying to mount the NFS share from the server. I had a power outage over the weekend and this can be annoying when I am remote.



I would like to ensure that the NFS share is always mounted, so that if the client detects that the share isn't there it will attempt to remount it. I think this might involve autofs and/or upstart to ensure the share stays mounted, but I don't know how to do this.



I am mounting it via the following method in /etc/fstab:



jillybean.local:/share /share nfs rsize=32768,rw,soft,intr

More From » nfs

 Answers
3

There are multiple things you could do:




  • add the retry=n (with n being an integer representing minutes) to your mount options in /etc/fstab for the cases NFS is not (yet) available at boot time

  • make use of autofs, as you suggested (lots of How-Tos returned by this Google search)

  • create some simple daemon process which exits when the NFS share is not available, and mounts it when invoked with the start parameter -- so you can set it up as upstart event with respawn (i.e. automatically restart when aborted other than by service xyz stop). Combine this with above retry=n)

  • setup a cron job checking for some (existing) directory on the NFS share -- and run the mount command when it is not found (again, combine it with retry=n)


[#37336] Monday, April 3, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
reangi

Total Points: 213
Total Questions: 102
Total Answers: 114

Location: Namibia
Member since Wed, Jan 19, 2022
2 Years ago
reangi questions
;