Linux NFS挂载报错wrong fs type, bad option, bad superblock

1.故障现象

我的测试环境有一个NAS,之前配置都是按照测试需求在/etc/fstab里添加配置挂载选项:
vi /etc/fstab

192.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
This entry was posted in Linux and tagged . Bookmark the permalink.