i need mount at boot a disk using NFS, to mount manually from console i type:
mount //192.168.0.1/NASShare -o username=administrator,password=pass /mnt/NAS
To /etc/fstab
i added this line:
192.168.0.1:/NASShare /mnt/NAS nfs user=administrator,password=pass 0 0
But at reboot the disk is not mounted, where is the error?
I found the error, i need insert
username
instead ofuser
You don't specify in your question whether you are trying to use NFSv3 or NFSv4, but neither supports a
password
parameter. Theuser
parameter isn't even recognized byNFS
ormount.nfs
, it is handled purely bymount
, and essentially allows non-root users to mount the filesystem. Theuser
parameter (orusers
, if un-mounting is also desired) can be specified by itself with no additional arguments (i.e.mount -t nfs -o user
) and indicates that any user can mount the filesystem.Even after supplying the
user
option tomount
, an NFS export that is listed in/etc/fstab
will not be mounted as the logged-in user, because/etc/fstab
is sourced before any user is logged in, so it will still be mounted as root. All working solutions that require supplying theuser
option tomount
currently rely on also supplying thenoauto
option, and then running the mount command manually after login, as the user that you wish to mount the NFS export with.NFS does not support sending plaintext passwords over the network, so you should never find yourself specifying a password as a mount option.