AlpineLinux 3.8: Install nfs-utils for NFS client

This article will describe installing nfs-utils for NFS client.

1 Install nfs-utils

Install nfs-utils package.

$ sudo apk add nfs-utils
$ sudo rc-update add nfsmount
$ sudo rc-service nfsmount start

2 Mount NFS with mount.nfs

Mount NFS with mount.nfs to /mnt directory.

$ NFS_SERVER=nfs-server.hiroom2.com
$ NFS_DIR=/srv/nfsshare
$ sudo mount -t nfs ${NFS_SERVER}:${NFS_DIR} /mnt

3 Mount NFS on boot

Add mount entry to /etc/fstab. For avoiding mounting NFS before network initialization, you need to add _netdev option.

$ echo "${NFS_SERVER}:${NFS_DIR} /mnt nfs _netdev 0 0" | \
sudo tee -a /etc/fstab