smbmnt and disabling mtab update

Urban Widmark urban at
Tue Feb 1 17:46:05 GMT 2000

On Tue, 1 Feb 2000, Dr. David Gilbert wrote:

> Hi,
>   I'm trying to run smbmount on a machine with the root filesystem mounted
> as read only (it is a little embedded Linux PC which I want to pick up
> some files from its controlling NT box).

If the fs is read-only how do you add a mount to it? I didn't think you
could, but maybe you are mounting it somewhere else, or maybe I'm just

>   The problem is that smbmnt doesn't appear to support the -n flag that
> normal mount supports which avoids accessing /etc/mtab.

No. And neither does smbmount. I think mount should handle the mtab
changes itself, even when it runs an external mount program. So that
  mount -n -t smbfs -o username=xyz //srv/share /mnt/smb
would run without writing to mtab.

> Can any one suggest any solutions to this ?

A quick fix, thay may or may not compile ...

At the end of
is the code that adds to the mtab (at least for samba 2.0.6). A simple
#if 0
around that might work to get rid of the writes to the mtab and to the
mtab lockfile. Remove everything from the first MOUNTED"~" but stop before 
the return. (Note: untested).


More information about the samba mailing list