144

When mounting an NFS directory by doing:

sudo mount 192.168.1.5:/home/shared /mnt/common

I get the following error:

mount: wrong fs type, bad option, bad superblock on 192.168.1.5:/home/shared, 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.

The kernel is up to date.

The question was already asked (for example here and here), but are either not answered or the answers are not helpful in my case.

What is wrong?

  • 3
    I met this issue before, just install an extended tool sudo apt-get install cifs-utils – user413408 May 25 '15 at 1:41
  • 1
    user413408's fix didn't help me. – Nuzzolilo Jan 1 '16 at 20:42
  • Similar issues can be solved on CentOS clients by sudo yum install nfs-utils. – MarkHu May 20 '16 at 23:38
  • had the same error, because the drive had to be partitioned first! May sound obvious, but just putting it out there to start there. – MrE Aug 6 '16 at 23:04
177

The error message mentions:

(for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount. helper program)

This is relevant given that you are trying to mount NFS. The /sbin/mount.nfs helper program is provided by nfs-common. You can install it with:

sudo apt install nfs-common

On the other hand, if you are trying to mount CIFS, the helper program is provided by cifs-utils. You can install it with:

sudo apt install cifs-utils
  • 32
    Meaning: apt-get install nfs-common, if /sbin/mount.nfs is not already there. – Mads Skjern Feb 10 '15 at 8:15
  • 7
    This did it for me: "sudo apt-get install cifs-utils". – JedatKinports Mar 30 '17 at 9:18
  • On ubuntu 14 "/sbin/mount.nfs" is already present but still unable to mount with the same error mentioned. After installing "nfs-common", I was able to mount without any issues. – Ashwin Oct 5 '17 at 7:35
  • 1
    your package might be nfs-utils – msb Jan 22 at 1:56
60

Make sure mount.cifs is listed into /sbin:

ls -l /sbin/mount.cifs

Check to see if package cifs-utils is installed:

dpkg -l cifs-utils

If it isn't, install the cifs libraries with

sudo apt-get install cifs-utils
  • 11
    cifs can be installed via the cifs-utils package. – Minos Oct 9 '14 at 14:19
  • 3
    I would give you +100. DId help to end my misery :) – xebo Oct 3 '15 at 11:40
  • I had to reinstall cifs-utils on my system for some reason, it said it was installed, but the file at /sbin/mount.cifs was missing. – thouliha May 25 '16 at 17:50
  • 1
    This combined with sudo mount -t cifs //SERVER/FOLDER /media/FOLDER -o username=USER,domain=DOMAIN command enables you to mount file shares on Windows active directory domains. – Shital Shah Jun 3 '16 at 18:56
  • cifs-utils provides tools for working with samba shares (SMB/CIFS protocols), but OP needed to mount NFS shares, and needs to install nfs-common package instead, as suggested in this answer. NFS is different from SMB/CIFS! – gerlos Aug 25 '16 at 15:21
20

It appears that nfs-common package should be installed in order to be able to mount NFS directories.

sudo apt-get install nfs-common

When it's not, the mounting of an NFS directory results in the error I've got.

  • This solved the problem I had. +1 from me. – Milan Todorovic Apr 9 at 17:14
2

I was having this same problem in Ubuntu 14.04 LTS. I tried the nfs-common package install without any success.

I was able to resolve the same issue you had by:

  1. Going to the Linux "disks" application.
  2. Clicking the USB drive I was trying to mount in the devices section (window left).
  3. Clicking more actions under the Volumes filesystem partition section (two little gears right of the minus/plus signs).
  4. Clicking edit mount options (top of the mount options window).
  5. Clicking to TURN ON Automatic Mount Options.
  6. Then clicking the mount button (+ sign under volumes) -- this should change to a square.

This mounted my USB drive and resolved the issue.

2

I solved it by installing virtualbox. Do

sudo apt-get install virtualbox-guest-utils

It installs the mount.vboxsf

  • 3
    What makes you think the OP is running a virtualbox guest ? – Panther Apr 9 '15 at 3:58
  • 2
    I find this answer alright if he saw the same error when trying to connect from a Virtualbox guest, and he installed the virtualbox-guest-utils to solve the problem. It does not answer the OP question but answers somebody else facing the problem with virtualbox guest. – biocyberman Jun 9 '16 at 13:30
  • Although this may not answer OP's question, it solved my problem. – Paul Dec 21 '17 at 22:47
1

Try:

mount -t nfs 192.168.1.5:/home/shared /mnt/common

protected by heemayl Mar 16 '16 at 10:56

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.