1

I am trying to mount directory during boot up on Ubuntu 16.04. I followed the exact steps mentioned in this tutorial link. I was able to mount and umount the folders manually.

As mentioned in the tutorial i also made changes to /etc/fstab ,but unfortunately when i boot the system automatic mounting is failing.

Also tried manual mounting and both of them are working fine.

sudo mount -a
sudo start nfs-home.mount

/etc/fstab

nth@nthYOGA:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda8 during installation
UUID=3384679d-4d31-4617-b9e4-d4ba7f0d4334 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=CC87-B297  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda9 during installation
UUID=d18f6756-5068-4b1c-99f7-eeff16bf3edf none            swap    sw              0       0

XX.XX.XX.XX:/var/nfs/general    /nfs/general   nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
XX.XX.XX.XX:/home       /nfs/home      nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0 

Here are the logs

nth@nthYOGA:~$ systemctl status nfs-home.mount 
● nfs-home.mount - /nfs/home
   Loaded: loaded (/etc/fstab; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2018-05-10 20:49:24 CEST; 13min ago
    Where: /nfs/home
     What: XX.XX.XX.XX:/home
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 1038 ExecMount=/bin/mount XX.XX.XX.XX:/home /nfs/home -t nfs -o noatime,nolock,intr,tcp,actimeo=1800 (code=exited, status=32)


nth@nthYOGA:~$ journalctl -u nfs-home.mount 
-- Logs begin at Thu 2018-05-10 20:49:22 CEST, end at Thu 2018-05-10 21:05:01 CEST. --
May 10 20:49:24 nthYOGA systemd[1]: Mounting /nfs/home...
May 10 20:49:24 nthYOGA mount[1038]: mount.nfs: Network is unreachable
May 10 20:49:24 nthYOGA systemd[1]: nfs-home.mount: Mount process exited, code=exited status=32
May 10 20:49:24 nthYOGA systemd[1]: Failed to mount /nfs/home.
May 10 20:49:24 nthYOGA systemd[1]: nfs-home.mount: Unit entered failed state.


systemctl show nfs-home.mount 
Where=/nfs/home
What=XX.XX.XX.XX:/home
Options=rw,noatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,acregmin=1800,acregmax=1800,acdirmin=1800,acdirmax=1800,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.0.2,local_lock=none,addr=XX.XX.XX.XX
Type=nfs4
TimeoutUSec=1min 30s
ControlPID=0
DirectoryMode=0755
SloppyOptions=no
Result=success
ExecMount={ path=/bin/mount ; argv[]=/bin/mount XX.XX.XX.XX:/home /nfs/home -t nfs -o noatime,nolock,intr,tcp,actimeo=1800 ; ignore_errors=no ; start_time=[Thu 2018-05-10 21:15:06 CEST] ; stop_time=[Thu 2018-05-10 21:15:07 CEST] ; pid=2256 ; cod
Slice=system.slice
ControlGroup=/system.slice/nfs-home.mount
MemoryCurrent=18446744073709551615
CPUUsageNSec=18446744073709551615
TasksCurrent=18446744073709551615
Delegate=no
CPUAccounting=no
CPUShares=18446744073709551615
...
...
...
KillSignal=15
SendSIGKILL=yes
SendSIGHUP=no
Id=nfs-home.mount
Names=nfs-home.mount
Requires=-.mount system.slice
Wants=network-online.target
WantedBy=remote-fs.target
Conflicts=umount.target
Before=umount.target remote-fs.target
After=-.mount system.slice systemd-journald.socket network.target remote-fs-pre.target network-online.target
RequiresMountsFor=/nfs
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
Description=/nfs/home
LoadState=loaded
ActiveState=active
SubState=mounted
FragmentPath=/run/systemd/generator/nfs-home.mount
SourcePath=/etc/fstab
....
....
  • Can you post your /etc/fstab? – troylatroy May 10 '18 at 20:06
  • Hi, I have updated the description with fstabs file – BhanuKiran May 10 '18 at 20:22
0

I had the same issue. Fixed it by changing auto to x-systemd.automount,noauto in /etc/fstab.

Example:

192.168.178.42:/disk1/data /media/data nfs nouser,rsize=32768,wsize=32768,atime,x-systemd.automount,noauto,rw,dev,noexec,suid 0 0

From systemd.mount(5):

x-systemd.automount

An automount unit will be created for the file system. See systemd.automount(5) for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.