Tuesday 11 January 2022

How to Resolve wrong fs type while mounting NFS share on CentOS 7



NFS share is a network file sharing protocol. It is used to provide shared access to files and folders across Linux machines over the network. This error comes when the nfs-utils package is missing from the machine and will give the below error while mounting any NFS share point.
 
[root@linuxcnf ~]# mount 192.168.1.103:/nfsshare /mnt/
mount: wrong fs type, bad option, bad superblock on 192.168.1.103:/nfsshare,
       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.
[root@linuxcnf ~]#
 
This article describes How to Resolve wrong fs type while mounting NFS share on CentOS 7.
 
Step 1. Package installation: Run the following command to install nfs-utils package:
 
[root@linuxcnf ~]# yum install nfs-utils -y
Loaded plugins: fastestmirror
………………………
Installed:
  nfs-utils.x86_64 1:1.3.0-0.68.el7.2
 
Dependency Installed:
………………………
  tcp_wrappers.x86_64 0:7.6-77.el7
 
Complete!
[root@linuxcnf ~]#
 
Step 2. Mount a NFS Share: Run the following commands to mount the NFS share on /mnt directory:
 
[root@linuxcnf ~]# mount 192.168.1.103:/nfsshare /mnt/
[root@linuxcnf ~]#
 
Step 3. Configure for Auto Mount: Edit /etc/fstab and put the below entries at the end of the file to mount the NFS Share across reboot the machine:
 
[root@linuxcnf ~]# vi /etc/fstab
……………………………
192.168.1.103/nfsshare    /mnt/       nfs    default 0 0
[root@linuxcnf ~]#
 
[root@linuxcnf ~]# mount -a
[root@linuxcnf ~]#
 
Step 5. Verify the Mounting Status: Run the following command to verify mounting of the NFS Share:
 
[root@linuxcnf ~]# df -h /mnt/
Filesystem               Size  Used Avail Use% Mounted on
192.168.1.103:/nfsshare  8.0G  1.5G  6.6G  19% /mnt
[root@linuxcnf ~]#
 
Done!!! NFS Share is mounted successfully on CentOS 7 client and configured for auto mount.

No comments:

Post a Comment