I figured that I can use autofs instead of fstab to mount my NFS shares.
In order to make it work, follow the steps :
- Open /etc/auto.master in your editor of choice and add
/$catalog $configpath at the end of this file, where $catalog is the folder where you want your shares to be mounted (note that you have to create that directory manually), and $configpath is the path for shares config file.
- Edit your config file at $configpath in the following manner :
With following config your share will be mounted at $catalog/$sharename.
There's also another workaround to this problem, which is adding
soft option to your shares in fstab.