Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been able to mount my nas shares by first making directories in the /media folder, then :

sudo gedit /etc/fstab 

to include the following line for each share I want to auto-mount;

//servername/sharename  /media/windowsshare  cifs  guest,uid=1000,iocharset=utf8,codepage=unicode,unicode  0  0

Now, however, I upgraded to 12.10, and suddenly I'm not able to mount the shares after saving /etc/fstab and sudo mount -a, giving me this error:

Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(22): Invalid argument

When in Nautilus, The shares are visible under the network tab, unmounted, and when I click on a share, I get the following message:

mount: only root can mount // on /media/photos

I checked to ensure smbfs was installed, and no problems there. I'm stumped.

share|improve this question

10 Answers 10

up vote 1 down vote accepted

Not sure if this is the correct way to mount but it certainly works for me, seeing as I was having the exact same issue going from ubuntu 12.04 to 12.10.

So try:

//servername/sharename /media/windowsshare cifs guest,users   

I also use the noauto option since I'm not always on the same network I want to mount my shares manually. My exact fstab entry for my system is as follows...

//servername/sharename /home/USER/shares/I cifs guest,users,noauto

This entry was the only which would allow me to use a Torrent client to download straight to my external HDD's over my home network.

Also, maybe you should try mounting the shares in your home directory instead of /media which is a root folder.

share|improve this answer
OK! Worked as described. What I ended up doing was instead of going into terminal and manually doung "sudo mkdir /blah/blah" I opened Nautilus and right-click/create folder. For whatever reason manually creating the folders in terminal locked the folders into root-only permission, which, now that I think of it, was happening to me when trying to use the same script for fstab in KDE. I'm barely learning my way around Linux, so theres a new lesson for me! – Doug Oct 18 '12 at 3:23
UPDATE; my shares do mount, however, a couple things are not working properly. One, when booting 12.10, I get a system hang of about 20 seconds, with mounting errors, however, after logging in, shares ARE mounted. Secondly, many of my files and folders on the server have no write access, which shouldn't be. – Doug Oct 30 '12 at 19:28
@Doug don’t be surprised to find that sudo mkdir /blah/blah makes a directory with root-only permissions. it is exactly what it is supposed to do. New directories are by default created with the read, write and execute (i.e., run as a program if a program) permissions enabled for the owner (i.e., the creator of the directory by default) and group and the read and execute permissions enabled for other users source: man mkdir – törzsmókus Dec 2 '12 at 18:30
Thanks, I was having the same problem as the OP, this solved it for me. +1 – EM-Creations Mar 24 '13 at 16:19

I had the same error message, also after upgrading from 12.04 to 12.10.

mount.cifs(8) says:

Options to mount.cifs are specified as a comma-separated list of key=value pairs. It is possible to send options other than those listed here, assuming that the cifs filesystem kernel module (cifs.ko) supports them. Unrecognized cifs mount options passed to the cifs vfs kernel code will be logged to the kernel log.

I checked /var/log/kern.log and found, in my case:

CIFS: Unknown mount option "noatime"

So the fix for me was simply to remove this option from my /etc/fstab entry.

Trying your options, this message is written to kern.log:

CIFS: Unknown mount option "codepage=unicode"

It seems the behaviour of cifs.ko has changed from ignoring unrecognised options to failing when it sees one.

mount.cifs -V says it's version 5.5.

share|improve this answer

Installing cifs-utils with the command

sudo apt-get install cifs-utils

did the trick for me. There was a dependency for the file "keyutils" that got installed automatically at the same time. I did not install additionall smbnetfs as suggested by another user so this file may not be necessary.

share|improve this answer

I had the same problem after upgrade from 12.04 to 12.10.

In 12.04 I used smbfs and my fstab read:

//    /mnt/htpc/media smbfs rw,username=root,password=openelec,uid=1000    0    0

This worked until upgrade. To get working again I installed cifs-utils & smbnetfs:

sudo apt-get install cifs-utils smbnetfs

and changed smbfs to cifs in my /etc/fstab:

//    /mnt/htpc/media cifs rw,username=root,password=openelec,uid=1000    0    0
share|improve this answer
sudo apt-get install cifs-utils

fixed my trouble under a fresh 64-bit install of 12.10. (Also had installed smbnetfs before looking here. I believe both are needed, but am not positive.

share|improve this answer

I too have had this problem and the workaround I've used which helps very much with keeping recent documents in unity is to remove the unicode and those paramaters, but keep the rest: for 12.10 and later I use this: // /media/mainshare cifs guest,uid=1000 0 0

The uid=1000 gives you read/write access because our share is open to users. This workaround has saved 12.10 for me - otherwise I'd still keep to 12.04.

share|improve this answer

Ubuntustudio 12.10: Installing cifs-utils via "sudo apt-get install cifs-utils" helped me. I used to add the line below to /etc/fstab: // /mnt/musik cifs username=admin,password=admin 0 0

However in 12.10 I got the message (in danish):

*sudo mount /mnt/musik
mount: forkert filsystemtype, forkert tilvalg, ugyldig superblok på //,
       manglende tegnsæt, hjælpeprogram eller anden fejl
       (for flere filsystemer (f.eks. nfs, cifs) skal du måske
       bruge et /sbin/mount.<type>-hjælpeprogram)
       I nogle tilfælde vil du finde nyttige oplysninger i systemlogggen
       - prøv 'dmesg | tail'  eller lignende*

After installing cifs-utils everything works again :-)

Thank you all


share|improve this answer

As others have stated, install cifs-utils. It is available through Software Center. Took me a while to find the solution, which made me mad at myself because I remember having to install the same package when I first installed the network drive. DOH!

share|improve this answer

That was my exact situation , and solved by removing fsc option from the following line at etc/fstab :

// /media/mntfolder cifs fsc,rw,_netdev,iocharset=utf8 0 0

so the actual line shows like that:

// /media/mntfolder cifs rw,_netdev,iocharset=utf8 0 0

I found by trying different mount options by hand (so maybe a good idea to check your own error too).

I suppose that can be a bug, or fsc option has been removed, do not really know... Hope it helps someone anyway.

share|improve this answer

I had this error after upgrading from 12.04 to 12.10 as well.

Thanks for all the info that was shared -- I was able to use it and resolve my issue.

I also had the auto option specified. However, there was an additional issue. Checking the /var/log/kern.log I found this message:

CIFS VFS: Unable to select appropriate authentication method!

My /etc/fstab included the sec=lanman option.

//  /media/smb-public       cifs    credentials=/home/foo/.smbpasswd,uid=1000,gid=1000,user,sec=lanman 0       0

So I replaced that option with sec=ntlm and it is now working.

//  /media/smb-public       cifs    credentials=/home/foo/.smbpasswd,uid=1000,gid=1000,user,sec=ntlm 0       0

Again thanks everyone for the info.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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