# Mount Disagrees with the fstab

## sdct989

I've been experimenting with mounting domain shares for about an hour now.  I finally got all of my syntax squared away, figured out that I had to use cifs instead of smbfs, etc.  However, I seem to be experiencing a problem now, that doesn't quite make sense to me.  Whenever I mount a share with the following fstab entry (obviously ignore the < >, just using them to differentiate between actual entries and hidden user info):

```

//<server>/User$/<share> /home/<user>/<mountpoint> cifs domain=<domain>,noauto,uid=<user>,gid=<group>,users,user=<user> 0 0

```

It mounts fine, and works as it is supposed to, however, when I try to unmount it I get the following error:

```

umount: /home/<user>/<mountpoint> mount disagrees with the fstab

```

A brief look at the mtab shows:

```

//<server>/User$ /home/<user>/<mountpoint> cifs rw,mand,noexec,nosuid,nodev,user=<user> 0 0

```

Obviously, it is leaving off part of the path when writing to the mtab.  If I change this to reflect the fstab entry as:

```

//<server>/User$/<share> /home/<user>/<mountpoint> cifs rw,mand,noexec,nosuid,nodev,user=<user> 0 0

```

It will then work perfectly.  Does anyone know why it is leaving off the <share> or how to force it to include it?  My only guess so far is that it has something to do with the "$" of the hidden windows share...

----------

## richard.scott

what's the output from the "mount" command?

----------

## sdct989

mount shows similar to the mtab as follows:

```

//<server>/User$ on /home/<user>/<mountpoint> type cifs (rw,mand,noexec,nosuid,nodev,user=<user>)

```

----------

## richard.scott

 *sdct989 wrote:*   

> Does anyone know why it is leaving off the <share> or how to force it to include it?  My only guess so far is that it has something to do with the "$" of the hidden windows share...

 

Try putting in a \ before the $.

I believe it could be due to the shell treating the $ sign as the start of a variable.

----------

## sdct989

Thanks for your responses!

When I tried what you suggested I got:

```

$ mount personal/

Password: 

retrying with upper case share name

mount error 6 = No such device or address

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

```

Turning on debug it looks like:

```

$ mount -v personal/

parsing options: rw,noexec,nosuid,nodev,noauto,users,domain=<domain>,uid=1000,gid=1000,user=<user>

Password: 

mount.cifs kernel mount options unc=//<server>\User\$,ip=<ip_address>,pass=<password>,ver=1,rw,noexec,nosuid,nodev,noauto,domain=<domain>,uid=1000,gid=1000,user=<user>,prefixpath=<user>

retrying with upper case share name

mount.cifs kernel mount options unc=//<SERVER>\USER\$,ip=<ip_address>,pass=<password>,ver=1,rw,noexec,nosuid,nodev,noauto,domain=<domain>,uid=1000,gid=1000,user=<user>,prefixpath=<user>

mount error 6 = No such device or address

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

```

----------

## richard.scott

This just worked for me in my /etc/fstab:

```
//server/smile$         /local/path             cifs    dom=DOMAIN,noauto,user=username,pass=password 0 0
```

and then doing:

```
mount /local/path
```

worked  :Smile: 

Perhaps try taking off some of the options your using and add them back in one at a time.

----------

## HK

You're trying to mount not a share, but a subdir of a share? (in fact in //<server>/User$/<share> <share> is a dir and User$ is the share) I suppose that this is connected with the wrong mtab record.

----------

## sdct989

Correct, I'm trying to mount a subdirectory of a share.  I've never had a problem with this using SAMBA, is this a problem with CIFS?  Unfortunately I don't have a CIFS share available without the $ on the end.  Has anyone tried this?  Does it write the mtab entry correctly without the $?

----------

## darkphader

 *sdct989 wrote:*   

> Correct, I'm trying to mount a subdirectory of a share.

 

It has nothing to do with the hidden share ($), just a problem with cifs which may have already been fixed (but maybe not released yet). My experience is that root can still umount that mount-point (as it's not really really the share but a subdirectory of it). You may want to try the latest cifs code (svn or cvs, don't know what they use) and see if that helps.

----------

## richard.scott

 *HK wrote:*   

> You're trying to mount not a share, but a subdir of a share? (in fact in //<server>/User$/<share> <share> is a dir and User$ is the share) I suppose that this is connected with the wrong mtab record.

 

Yep, i'd have to agree on that one. I'd not seen the obvious!   :Embarassed: 

I've just tried to mount a //server/share$/folder with both CIFS and SAMBA and neither work!

You can only mount the share unless that share is already mounted and then you can mount a sub folder (I guess, but not tested yet)!

The only thing the server will be advertising is the share$ name so the folders won't be visible.

----------

## darkphader

 *richard.scott wrote:*   

> You can only mount the share unless that share is already mounted and then you can mount a sub folder 

 

Not correct. At least with CIFS (and Windows 2000 or greater), you can mount (connect/map) a subfolder of a share. The share itself does not have to be mounted first.

Chris

----------

## sdct989

Thanks for helping out with this you guys.

It makes a lot of sense, as darkphader said:

 *Quote:*   

> 
> 
> My experience is that root can still umount that mount-point (as it's not really really the share but a subdirectory of it).
> 
> 

 

So it doesn't impact me a whole lot.  I usually want the shares as long as I'm logged on anyway, so during shutdown it unmounts all the shares just fine.

Still, I hope that they do update CIFS soon to correct the issue.

----------

