# [SOLVED] CIFS not mounting under recent kernel versions...

## slackline

Hi,

I've been putting this off for a while but now have the time to investigate and well haven't got very far, so I'm seeking some assistance.

Under kernel version sys-kernel/gentoo-source-3.3.8-r1 I can mount CIFS network shares here at work no problem...

My /etc/fstab ...

[code file=/etc/fstab]

# Network drives

//Langsett/scharr	/mnt/scharr	cifs		credentials=/etc/nfs_share.credentials,users,rw,uid=<uid>,gid=<gid>,umask=133	0 0

//Langsett/shared2	/mnt/shared	cifs		credentials=/etc/nfs_share.credentials,users,rw.uid=<uid>,gid=<gid>,umask=133	0 0

//Langsett/usr22/MCR/Cm1nds /mnt/cm1nds	cifs		credentials=/etc/nfs_share.credentials,users,rw,uid=<uid>,gid=<gid>,umask=133	0 0

[/code]

Booting with the 3.3.8-r1 kernel I have /etc/init.d/netmount in my 'default' profile, and all three drives mount fine (below I unmount and then remount one with '-v' to demonstrate this, I also include the relevant kernel config options for that kernel)...

```

# uname -a

Linux morgan 3.3.8-gentoo-r1 #1 SMP Fri Jun 22 10:59:44 BST 2012 x86_64 Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz GenuineIntel GNU/Linux

# umount /mnt/cm1nds/

# morgan neil # mount -v /mnt/cm1nds/

mount.cifs kernel mount options: ip=143.167.248.56,unc=\\Langsett\usr22,umask=133,uid=1000,gid=1002,user=<user>,prefixpath=MCR/<user path>,pass=********

# grep -i cifs /usr/src/linux-3.3.8-gentoo-r1/.config

CONFIG_CIFS=y

# CONFIG_CIFS_STATS is not set

# CONFIG_CIFS_WEAK_PW_HASH is not set

# CONFIG_CIFS_UPCALL is not set

CONFIG_CIFS_XATTR=y

CONFIG_CIFS_POSIX=y

# CONFIG_CIFS_DEBUG2 is not set

# CONFIG_CIFS_DFS_UPCALL is not set

CONFIG_CIFS_ACL=y

```

However, when I boot into a 3.6.8 the network drives won't mount, complaining about 'Invalid arguments' top mount.cifs (this has been the case since 3.5.* but I've not had the time at work to address this problem, hence why I'm now on 3.6.8 with it)...

```

# uname -a

Linux morgan 3.6.8-gentoo #1 SMP Tue Nov 27 09:46:10 GMT 2012 x86_64 Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz GenuineIntel GNU/Linux

# mount -v /mnt/cm1nds/

mount.cifs kernel mount options: ip=143.167.248.56,unc=\\Langsett\usr22,umask=133,uid=1000,gid=1002,user=cm1nds,prefixpath=MCR/Cm1nds,pass=********

mount error(22): Invalid argument

Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

# grep -i cifs /usr/src/linux/.config

CONFIG_CIFS=y

# CONFIG_CIFS_STATS is not set

# CONFIG_CIFS_WEAK_PW_HASH is not set

# CONFIG_CIFS_UPCALL is not set

CONFIG_CIFS_XATTR=y

CONFIG_CIFS_POSIX=y

# CONFIG_CIFS_DEBUG2 is not set

# CONFIG_CIFS_DFS_UPCALL is not set

CONFIG_CIFS_ACL=y

```

The kernel options are unchanged, the version of net-fs/cifs-utils has changed a few times...

```

# genlop -s cifs-utils

 * matches found:

     Thu Jul 26 12:00:49 2012 >>> net-fs/cifs-utils-5.5-r1

     Fri Sep 14 07:03:25 2012 >>> net-fs/cifs-utils-5.6

     Wed Sep 19 08:56:04 2012 >>> net-fs/cifs-utils-5.6-r1

     Mon Nov 26 09:45:11 2012 >>> net-fs/cifs-utils-5.8

```

But I'm stumped.  I've tried recompiling net-fs/cifs-utils against the newer, running kernel, but no joy.

Cheers,

slack

----------

## audiodef

I wonder if this is more about udev than the kernel. Try putting udev-mount in your sysinit runlevel, and make sure nfsmount is in your default runlevel.

----------

## slackline

 *audiodef wrote:*   

> I wonder if this is more about udev than the kernel. Try putting udev-mount in your sysinit runlevel, and make sure nfsmount is in your default runlevel.

 

Hadn't thought of that, but its already there...

```

# rc-update show | grep mount

           localmount | boot                                          

             mount-ro |                        shutdown               

             netmount |      default                                  

           udev-mount |                                        sysinit

```

----------

## Xootneg

I'm running a 32 bit, x86 environment with 3.5.7 kernel sources. I did a brand new install about 2 weeks ago. 

Before I did the first world update, cifs was mounting with fstab perfectly with the 3.5.7 kernel.  What killed the fstab, cifs mounting ability for me was the first world update that had 21 updates (etc-updates). This eliminated the kernel as the cifs mounting issue culprit and pointed to 1 or more of the init.d file updates as the problem. 

Here is the complete list of updates i did. Afterwards cifs would no longer mount with the 3.5.7 gentoo-sources kernel or the 3.3.8 kernel:

sys-fs/udev-171-r9 from sys-fs/udev-171-r8

app-text/libspectre-0.2.7 from app-text/libspectre-0.2.6

sys-apps/openrc-0.11.5 from sys-apps/openrc-0.9.8.4

 1. /etc/rc.conf (1)

 2. /etc/conf.d/hwclock (1)

 3. /etc/init.d/bootmisc (1)

 4. /etc/init.d/consolefont (1)

 5. /etc/init.d/devfs (1)

 6. /etc/init.d/dmesg (1)

 7. /etc/init.d/fsck (1)

 8. /etc/init.d/hwclock (1)

 9. /etc/init.d/keymaps (1)

10. /etc/init.d/localmount (1) *

11. /etc/init.d/mount-ro (1)

12. /etc/init.d/net.lo (1)

13. /etc/init.d/netmount (1) *

14. /etc/init.d/procfs (1) *

15. /etc/init.d/root (1)

16. /etc/init.d/savecache (1)

17. /etc/init.d/swap (1)

18. /etc/init.d/sysctl (1)

19. /etc/init.d/sysfs (1)

20. /etc/init.d/termencoding (1)

21. /etc/init.d/urandom (1)

I think it MIGHT be coming from one or more of the 3 asterisked files, fwiw.

I did change to the 3.3.8 kernel to see if that would fixed it, and it did NOT. I have read a lot of online content concerning this issue where most feel it is related to the 3.5.7 kernel, but in my case it is not the kernel at all. I have a work-a-round, but would definitely prefer auto mounting my window shares.

--

www.eldoradocountyweather.com

----------

## kite14

Hello slack---line,

I don't know if it's the same problem, but I had a similar issue when mounting CIFS shares, and I could narrow down my troubleshooting to the upgrade of net-fs/samba (from version 3.5.15 to 3.6.9). 

Before update, the mount.cifs executable was provided by net-fs/samba, after update it is provided by net-fs/cifs-utils and I've found out it doesn't support the same options as the previous version. 

In my case fmask and dmask options had to be changed in file_mode and dir_mode respectively.

I took a quick look at mount.cifs manpage and I couldn't find reference for the umask option that you use in /etc/fstab files; hope this can be a good hint for your troubleshooting.Last edited by kite14 on Wed Nov 28, 2012 10:37 pm; edited 2 times in total

----------

## slackline

Thanks for the suggestions Xootneg & kite14 much appreciated.

Removing the 'umask=133' has allowed two of the network drives to now be mounted automatically, but not the third which still complains of errors...

```

 # /etc/init.d/netmount restart

 * Unmounting network filesystems ...                                                                                                                                                                                                                                    [ ok ]

 * Mounting network filesystems ...

mount error(22): Invalid argument

Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)                                                                                                                                                                                                             [ ok ]

morgan etc # df -h

Filesystem                   Size  Used Avail Use% Mounted on

rootfs                        20G   14G  4.8G  75% /

/dev/root                     20G   14G  4.8G  75% /

devtmpfs                     3.9G     0  3.9G   0% /dev

tmpfs                        3.9G  476K  3.9G   1% /run

shm                          3.9G  380K  3.9G   1% /dev/shm

cgroup_root                   10M     0   10M   0% /sys/fs/cgroup

/dev/sda1                     54M   38M   13M  75% /boot

/dev/sda3                    9.9G  2.9G  6.6G  31% /usr/portage

/dev/sda4                    118G   87G   25G  78% /home

//Langsett/usr22/MCR/Cm1nds  179G  135G   45G  76% /mnt/cm1nds

//Langsett/scharr            1.7T  1.3T  366G  78% /mnt/scharr

```

Strange and I'll continue to investigate, but not a work-stopper as I very, very rarely use that network drive.

Cheers,

slack

----------

## kite14

If the /etc/fstab file you posted above  is a verbatim copy of your actual /etc/fstab, then take a closer look between the "rw" and "uid=<uid>" options:

```
//Langsett/shared2 /mnt/shared cifs credentials=/etc/nfs_share.credentials,users,rw.uid=<uid>,gid=<gid>,umask=133 0 0 
```

There's definetely a typo here...

----------

## slackline

 *kite14 wrote:*   

> If the /etc/fstab file you posted above  is a verbatim copy of your actual /etc/fstab, then take a closer look between the "rw" and "uid=<uid>" options:
> 
> ```
> //Langsett/shared2 /mnt/shared cifs credentials=/etc/nfs_share.credentials,users,rw.uid=<uid>,gid=<gid>,umask=133 0 0 
> ```
> ...

 

Well spotted, thanks and apologies for not seeing it myself.

----------

## Xootneg

I just wanted to add that I did a new install of Gentoo a few days ago and all is back to normal. No more issues of auto mounting window shares at boot up. What was the culprit? I honestly have no clue. I haven't used Samba in years and still don't, but I do use net-fs/cifs-utils-5.6-r1...

----------

## kite14

Xootneg, 

I'm afraid I don't have any more suggestions on this topic. 

I've read again your first post and I don't think the culprit is one of 

the "init" files: those are used to start/stop a daemon and something

wrong here should effect many more users. In addition, these are not

usually modified/customized by users, like "conf" files.

Next time I would check for typos in /etc/fstab or path to the credentials file.

----------

