1.故障現象
我的測試環境有一個NAS,之前配置都是按照測試需求在/etc/fstab里添加配置掛載選項: vi /etc/fstab192.168.1.2:/mnt/HD/HD_a2/Public /public nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600
創建/public目錄后,直接mount掛載即可:
mkdir /public
mount -a
但今天在一套最小化安裝的RHEL6.8上,掛載時遇到報錯如下:
[root@test04 ~]# mount -a
mount: wrong fs type, bad option, bad superblock on 192.168.1.2:/mnt/HD/HD_a2/Public,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so
2.解決方案
解決方法是安裝nfs-utils:[root@test04 ~]# yum install nfs-utils
再次嘗試掛載報錯:
[root@test04 ~]# mount -a
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
這個報錯比較明顯了,需檢查下rpc.statd對應的rpcbind服務狀態,啟動這個服務並確保其之后開機自啟動:
[root@test04 ~]# service rpcbind status
rpcbind is stopped
[root@test04 ~]# service rpcbind start
Starting rpcbind: [ OK ]
[root@test04 ~]# chkconfig --list rpcbind
rpcbind 0:off 1:off 2:on 3:on 4:on 5:on 6:off
再次嘗試掛載成功:
[root@test04 ~]# mount -a
[root@test04 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_test04-lv_root
18G 829M 16G 5% /
tmpfs 939M 0 939M 0% /dev/shm
/dev/sda1 477M 39M 414M 9% /boot
192.168.1.2:/mnt/HD/HD_a2/Public
2.7T 1.6T 1.2T 57% /public