fstab settings for nfs volume mount
fstab settings for nfs volume mount
Hi,
I've got Synology NAS and NFS permission setup, all working perfectly fine.
Only thing I have an issue now is that volumes are not mounted at system startup.
I have to go and sudo mount -a after every reboot. After that evreything works perfectly fine.
Any idea what is going on?
A friend suggested it could be network issue like network still not fully up so is there a way to postpone mount for couple seconds?
Hre is what I have in fstab at the moment:
<IP>:/volume1/P /media/Storage/P nfs rsize=8192,wsize=8192,timeo=14,intr
<IP>:/volume1/Work /media/Storage/Work nfs rsize=8192,wsize=8192,timeo=14,intr
<IP>:/volume1/homes /media/Storage/homes nfs rsize=8192,wsize=8192,timeo=14,intr
<IP>:/volume1/D /media/Storage/D nfs rsize=8192,wsize=8192,timeo=14,intr
Thanks
I've got Synology NAS and NFS permission setup, all working perfectly fine.
Only thing I have an issue now is that volumes are not mounted at system startup.
I have to go and sudo mount -a after every reboot. After that evreything works perfectly fine.
Any idea what is going on?
A friend suggested it could be network issue like network still not fully up so is there a way to postpone mount for couple seconds?
Hre is what I have in fstab at the moment:
<IP>:/volume1/P /media/Storage/P nfs rsize=8192,wsize=8192,timeo=14,intr
<IP>:/volume1/Work /media/Storage/Work nfs rsize=8192,wsize=8192,timeo=14,intr
<IP>:/volume1/homes /media/Storage/homes nfs rsize=8192,wsize=8192,timeo=14,intr
<IP>:/volume1/D /media/Storage/D nfs rsize=8192,wsize=8192,timeo=14,intr
Thanks
Re: fstab settings for nfs volume mount
Set it up using autofs instead of fstab.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: fstab settings for nfs volume mount
You will need to add _netdev to your mount options.
As you are using CentOS 7 a better method would be to use systemd. I have an example posted here for CIFS that you could modify for NFS.
As you are using CentOS 7 a better method would be to use systemd. I have an example posted here for CIFS that you could modify for NFS.
Re: fstab settings for nfs volume mount
Tried both options.
Followed guide for autonfs, everything is there but the mount doesn't happen at all.
Tried with _netdev option too as a friend suggested but also no luck.
Weird is that on another home machine when I tested centos it worked perfectly fine.
Also, mint testing went fine and automounting with identical fstab settings.
Only this comp is not doing it.
Considering reinstall and see what happens...
Followed guide for autonfs, everything is there but the mount doesn't happen at all.
Tried with _netdev option too as a friend suggested but also no luck.
Weird is that on another home machine when I tested centos it worked perfectly fine.
Also, mint testing went fine and automounting with identical fstab settings.
Only this comp is not doing it.
Considering reinstall and see what happens...
-
- Posts: 1522
- Joined: 2014/05/21 20:16:00
- Location: Central New York, USA
Re: fstab settings for nfs volume mount
Is there an error message produced? Also, having done it several times, do your /media/storage/* folders exist?
Re: fstab settings for nfs volume mount
hehe yes they are there, it all works perfectly fine when I have fstab entry and do sudo mount -a
no error, just mounting is not happening until I do it manually.
but as I said I will proably do fresh reinstall of Centos and see what happens jstuj to wrap up some work I have. Interested to see if it will work then
no error, just mounting is not happening until I do it manually.
but as I said I will proably do fresh reinstall of Centos and see what happens jstuj to wrap up some work I have. Interested to see if it will work then
-
- Posts: 1522
- Joined: 2014/05/21 20:16:00
- Location: Central New York, USA
Re: fstab settings for nfs volume mount
couple more thoughts before the 'extreme' -
Is nfs-utils installed. I don't know if it matters, but it's installed here; also doesn't account for it working from the command line.
I've skipped clean re-installs in the past by rebooting to an older kernel, running yum reinstall *.*, then rebooting into the current kernel. This especially helped when I'd clobbered permissions somehow.
Is nfs-utils installed. I don't know if it matters, but it's installed here; also doesn't account for it working from the command line.
I've skipped clean re-installs in the past by rebooting to an older kernel, running yum reinstall *.*, then rebooting into the current kernel. This especially helped when I'd clobbered permissions somehow.
Re: fstab settings for nfs volume mount
RHEL recommends to add the systemd automounts into the /etc/fstab:
The systemd will create a unit at boot. If you edit the fstab entry further, then you have to make systemd reload or reboot in order to enable the changes.
The config above will mount the volume automatically the first time you access /media/Storage/P.
This will mount during boot whether you ever use it or not:
If you yum install autofs
The /etc/auto.master contains
Thus, you coould write an .autofs file:
and the map file:
# cat /etc/auto.master.d/auto.net
and then
The "cool" thing about autofs is that unused volumes unmount (and remount when you need them again).
You probably want in /etc/autofs.conf:
(The autofs default is 'yes', but the default config in CentOS has 'no'.)
Code: Select all
<IP>:/volume1/P /media/Storage/P nfs defaults,noauto,nofail,x-systemd.automount 0 0
The config above will mount the volume automatically the first time you access /media/Storage/P.
This will mount during boot whether you ever use it or not:
Code: Select all
<IP>:/volume1/P /media/Storage/P nfs _netdev,defaults,nofail 0 0
Note:_netdev The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).
intr / nointr This option is provided for backward compatibility. It is ignored after kernel 2.6.25.
If you yum install autofs
The /etc/auto.master contains
Code: Select all
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
Code: Select all
# cat /etc/auto.master.d/local.autofs
/media/Storage /etc/auto.master.d/auto.net
# cat /etc/auto.master.d/auto.net
Code: Select all
P -fstype=nfs,hard,nodev,nosuid <IP>:/volume1/P
Work -fstype=nfs,hard,nodev,nosuid <IP>:/volume1/Work
Code: Select all
systemctl enable autofs
systemctl start autofs
You probably want in /etc/autofs.conf:
Code: Select all
browse_mode = yes