8

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 //192.168.1.71/photos on /media/photos

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

1

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.

  • 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
4

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.

3

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.

2

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

In 12.04 I used smbfs and my fstab read:

//192.168.0.42/Media    /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:

//192.168.0.42/Media    /mnt/htpc/media cifs rw,username=root,password=openelec,uid=1000    0    0
1
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.

0

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: //192.168.0.20/mainshare /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.

0

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

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

so the actual line shows like that:

//192.168.1.1/smbshare/ /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.

0

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.

//192.168.1.101/Public  /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.

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

Again thanks everyone for the info.

0

Thanks to the enlightening discussion on this at https://ubuntuforums.org/showthread.php?t=2375075 , I was eventually able to get it working. In my case, following error was reported

satyadeep@satyadeep:~$ sudo mount -a
[sudo] password for satyadeep: 
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

I monitored and saw the following in kern.log

11:09 $ tail -f  /var/log/kern.log 
Mar  1 10:06:51 satyadeep kernel: [160456.442423] input: USB Optical Mouse as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/0003:0461:4D81.0003/input/input13
Mar  1 10:06:51 satyadeep kernel: [160456.442670] hid-generic 0003:0461:4D81.0003: input,hidraw0: USB HID v1.11 Mouse [USB Optical Mouse] on usb-0000:00:1d.0-1.2/input0
Mar  1 10:30:33 satyadeep kernel: [161879.205573] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
Mar  1 10:30:33 satyadeep kernel: [161879.206637] CIFS VFS: Unable to select appropriate authentication method!
Mar  1 10:30:33 satyadeep kernel: [161879.206640] CIFS VFS: Send error in SessSetup = -22
Mar  1 10:30:33 satyadeep kernel: [161879.206658] CIFS VFS: cifs_mount failed w/return code = -22
Mar  1 10:48:22 satyadeep kernel: [162948.218284] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
Mar  1 10:48:22 satyadeep kernel: [162948.219378] CIFS VFS: Unable to select appropriate authentication method!
Mar  1 10:48:22 satyadeep kernel: [162948.219382] CIFS VFS: Send error in SessSetup = -22
Mar  1 10:48:22 satyadeep kernel: [162948.219408] CIFS VFS: cifs_mount failed w/return code = -22

As indicated, I changed fstab as follows:

//QQQ/share/sdm /mnt/store cifs username=XXX,password=YYY,domain=ZZZ,iocharset=utf8,sec=ntlm,vers=1.0  0 0

Notice that extra

vers=1.0

parameter. Afterwards I did

satyadeep@satyadeep:~$ sudo mount -a

And it worked like charm!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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