Problems with auto mounting a NFS share at boot: probably because rpcbind is not started

Hi,
my problem is the rpcbind service does not start at boot, i want to change that such that it starts automatically.
Now a few more details:
i wanted to mount a NFS share from NAS on my home directory using this command:

sudo mount -t nfs 192.168.0.30:/mnt/volume1/usernas/dir1 /home/userlocal/dir2

this does not work i get this output:


root's password:
Starting rpc.statd ... portmapper not running                        failed
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

typing


sudo service rpcbind status

shows


rpcbind.service - RPC Bind
   Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; disabled)
   Active: inactive (dead)

so i tried to start the service:


sudo service rpcbind start

thats started the service and i was able to mount the NFS share with the command i posted at the start of this post.

My next step was to add the same mount to the /etc/fstab to automate the mounting so i added this line to the:

192.168.0.17:/mnt/volume1/usernas/dir1          /home/userlocal/dir2   nfs       auto                  0 0

but i forgot about the rpcbind service i think because after a reboot the share was not mounted, i am not sure was the exact problem was (i do not now which log to look at) but i tried to mount the share by myself using the command posted above, but this did not worked because of the rpcbind service was not started, after starting it i was able to do the mount.

So my question is, what do i have to do to autostart the rpcbind service and hopefully automount the share?

btw: the ips in the manual mount and the /etc/fstab does not fit, thats a mistake i made only in this post, on my pc they are correct in both cases.

I just enabled the rpcbind service on the Yast service manager now it is started when the pc starts kde but automounting still does not work, but i can manually mount now right after start but thats not what i want.

On 2014-07-31 22:56, sabo007 wrote:

> So my question is, what do i have to do to autostart the rpcbind service
> and hopefully automount the share?


systemctl status nfs.service
systemctl start nfs.service
systemctl enable nfs.service
systemctl status nfs.service

That’s should be it.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

When trying to enable the service using:

sudo systemctl enable nfs.service

i get the following output:

nfs.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig nfs on
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).

On 2014-08-01 02:26, sabo007 wrote:
>
> When trying to enable the service using:
>
> Code:
> --------------------
> sudo systemctl enable nfs.service
> --------------------
>
> i get the following output:

Ignore that. What says the status command after it?

Try


chkconfig nfs
chkconfig nfs on
chkconfig nfs

Despite appearances, the command I posted before also works:


minas-tirith:~ # chkconfig nfs
nfs  off
minas-tirith:~ # systemctl enable nfs.service
nfs.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig nfs on
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
minas-tirith:~ # chkconfig nfs
nfs  on
minas-tirith:~ #


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

For the client end, you should only need to configure via YaST >> Network Services >> NFS Client

The status output is:

nfs.service - LSB: NFS client services
   Loaded: loaded (/etc/init.d/nfs)
  Drop-In: /run/systemd/generator/nfs.service.d
           └─50-insserv.conf-$remote_fs.conf
   Active: active (running) since Fr 2014-08-01 02:21:55 CEST; 58min ago
   CGroup: /system.slice/nfs.service
           ├─4213 /usr/sbin/rpc.gssd -D -p /var/lib/nfs/rpc_pipefs
           └─4219 /usr/sbin/rpc.idmapd -p /var/lib/nfs/rpc_pipefs

I did not found the nfs service in yast -> network services

There isn’t. The nfs service can be conrolled via YaST >> System >> Services Manager
or using

systemctl start nfs

Enabling the nfs.service via systemctl worked, after the next reboot the share was automatically mounted. Thank you.

On Fri 01 Aug 2014 08:06:02 PM CDT, sabo007 wrote:

Enabling the nfs.service via systemctl worked, after the next reboot the
share was automatically mounted. Thank you.

Hi
Just an FYI, enabling a service just sets it to start on the next
reboot, if you had used systemctl start <some_service> then you would
not have needed to reboot :wink: There is also status which you would run
after start, then say you make some modifications to the configuration
file, you could then use restart. All the same sorts of commands used
with sysvinit…


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.1 Kernel 3.11.10-17-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

On 2014-08-01 22:40, malcolmlewis wrote:
> Just an FYI, enabling a service just sets it to start on the next
> reboot

…which was precisely what he wanted, the mount to happen automatically
on boot :wink:

(so he needed booting for testing it)


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Yes i wanted the service to automatically start on boot, because that seemed to be the reason why the /etc/fstab mount did not worked. Manually mounting the share seemed to start the nfs service automatically because i never had to start the nfs service by myself before.
Anyway thank you both for helping.