Linux – NFS/smb shares

How to mount NFS and smb shares at boot:

On the NFS Server: Add the client ip address to the permission list

On NFS Client: Install nfs-common

apt-get install nfs-common

On NFS / SMB Client: Add to /etc/fstab

SERVERIP://FOLDER/SUBFOLDER    /mnt/mountpoint  nfs flags                       0 0
192.168.0.10://volume1/public  /mnt/nfs         nfs auto,nolock,noatime,_netdev 0 0

//SERVERIP/SHARE               /mnt/mountpoint  cifs username=user,password=password,domain=Group1,vers=1.0,auto,_netdev 0 0
//192.168.2.9/public           /mnt/smb         cifs username=john,password=12345678,domain=Group1,vers=1.0,auto,_netdev 0 0

Optional: If shares won’t get mounted after reboot

On NFS / SMB Client: Create and edit file: /etc/network/if-up.d/fstab

#!/bin/sh
mount -a

Make it executable:

sudo chmod +x /etc/network/if-up.d/fstab