Problem
I have configured a new server with RHEL 7.4 as a web server. I tried to mount an NFS shared folder on this machine and got the below error:
[root@RHEL7.4 ~]# mount -o tcp nfsserver:/upload /home/upload mount: wrong fs type, bad option, bad superblock on 10.30.1.62:/upload, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount. helper program) In some cases useful info is found in syslog - try dmesg | tail or so. [root@RHEL7.4 ~]#
Reason
- The nfs-utils package was not installed on the NFS client system. This package is required to mount the NFS share in the client system.
Solution
- Log in as root/superuser and first check that nfs-utils package is installed or not. The below command does not show any package it means the nfs-utils package is not installed.
[root@RHEL7.4 ~]# rpm -qa nfs-utils
- Install the nfs-utils package using the yum command. To install a package from the yum command you need to create a repository first or you should have internet access on the server.
[root@RHEL7.4 ~]# yum install nfs-utils Loaded plugins: product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. Resolving Dependencies --> Running transaction check ---> Package nfs-utils.x86_64 1:1.3.0-0.48.el7_4 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================ Package Arch Version Repository Size ================================================================================================================================ Installing: nfs-utils x86_64 1:1.3.0-0.48.el7_4 InstallMedia 398 k Transaction Summary ================================================================================================================================ Install 1 Package Total download size: 398 k Installed size: 1.0 M Is this ok [y/d/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Warning: RPMDB altered outside of yum. Installing : 1:nfs-utils-1.3.0-0.48.el7_4.x86_64 1/1 Verifying : 1:nfs-utils-1.3.0-0.48.el7_4.x86_64 1/1 Installed: nfs-utils.x86_64 1:1.3.0-0.48.el7_4 Complete! [root@RHEL7.4 ~]#
- Now you can check that nfs-utils package has been installed.
[root@RHEL7.4 ~]# rpm -qa nfs-utils nfs-utils-1.3.0-0.48.el7_4.x86_64 [root@RHEL7.4 ~]#
- Now you can successfully mount the NFS shared folder.
[root@RHEL7.4 ~]# mount -o tcp nfsserver:/upload /home/upload
- Check and verify the mount points.
[root@RHEL7.4 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 18G 1.3G 17G 8% / devtmpfs 16G 0 16G 0% /dev tmpfs 16G 0 16G 0% /dev/shm tmpfs 16G 8.6M 16G 1% /run tmpfs 16G 0 16G 0% /sys/fs/cgroup /dev/sda2 497M 136M 361M 28% /boot /dev/mapper/rhel-home 20G 1.1G 19G 6% /home /dev/mapper/rhel-var 80G 109M 80G 1% /var tmpfs 3.2G 0 3.2G 0% /run/user/0 nfsserver:/upload 3.0T 2.6T 227G 93% /home/upload [root@RHEL7.4 ~]#
Last Updated: September 27, 2018