Possible to mount Samba filesys (smbfs) via ordinary 'mount' command?

Possible to mount Samba filesys (smbfs) via ordinary 'mount' command?

Post by Kenny McCorma » Sun, 20 Jun 1999 04:00:00



I have Samba working fine and can mount drives on my 9x/NT boxes from
Linux using smbmount.  However, it would be nice if it could be done
using ordinary 'mount', using the normal mount syntax - and,
eventually, to be done via entries in the /etc/fstab file.

Is this possible?

"man mount" says this on the subject:

Mount options for smbfs
       Just like nfs, the smb  implementation  expects  a  binary
       argument  (a  struct  smb_mount_data)  to the mount system
       call. This argument is constructed by smbmount(8) and  the
       current  version  of  mount  (2.6c) does not know anything
       about smb.

.... which seems to say, "You're on your own in getting this to work".

I can do: smbmount //machine/service /mnt -U someuser -I machine
but when I do: mount -t smbfs //machine/service /mnt
it doesn't work.  The question is: How to pass those other args to
mount that smbmount needs?

Please help...

 
 
 

Possible to mount Samba filesys (smbfs) via ordinary 'mount' command?

Post by Rod Smi » Sun, 20 Jun 1999 04:00:00


[Posted and mailed]



Quote:> I have Samba working fine and can mount drives on my 9x/NT boxes from
> Linux using smbmount.  However, it would be nice if it could be done
> using ordinary 'mount', using the normal mount syntax - and,
> eventually, to be done via entries in the /etc/fstab file.

I've been casually looking for something like this for some time, with no
luck.  I did recently run across the following in the smbmount man page:

: To mount an smb file system, I suggest using the option -c
: for smbmount to pass the mount command. For example, use

: smbmount "\\server\tmp" -c 'mount /mnt -u 123 -g 456'

: to  mount  the  tmp  share  of server on /mnt

This did work for me.  I've not yet tried to combine this with user
permissions in the /etc/fstab file to see if this might allow normal users
to do it.  Perhaps a suid root script could do it, though....

--
Rod Smith

http://www.channel1.com/users/rodsmith
NOTE: Remove the "uce" word from my address to mail me

 
 
 

Possible to mount Samba filesys (smbfs) via ordinary 'mount' command?

Post by Kenny McCorma » Sun, 20 Jun 1999 04:00:00






>> I have Samba working fine and can mount drives on my 9x/NT boxes from
>> Linux using smbmount.  However, it would be nice if it could be done
>> using ordinary 'mount', using the normal mount syntax - and,
>> eventually, to be done via entries in the /etc/fstab file.

>I've been casually looking for something like this for some time, with no
>luck.  I did recently run across the following in the smbmount man page:

>: To mount an smb file system, I suggest using the option -c
>: for smbmount to pass the mount command. For example, use

>: smbmount "\\server\tmp" -c 'mount /mnt -u 123 -g 456'

>: to  mount  the  tmp  share  of server on /mnt

Curiously, my "man smbmount" documents the -c option as a way to
specify the "client name" - whatever that is.  It doesn't looke like a
command string at all.  FWIW, the -C option is for disabling the
uppercasing of passwords, so that ain't it either...

Quote:>This did work for me.  I've not yet tried to combine this with user
>permissions in the /etc/fstab file to see if this might allow normal users
>to do it.  Perhaps a suid root script could do it, though....

When you run smbmount as non-root, it says "/usr/sbin/smbmount must be
installed suid-root".  Although I haven't tested it, this seems to
imply that simply making the executable setuid root would allow users
to smbmount stuff.

But that is not my goal here.  What I want is to be able to call mount
and have it, internally call smbmount, if necessary, to do the work.
My goal is not the idea of making it user (in the sense of "non-root")
accessible, but rather, I'd like to avoid having to write a separate
user-interface for smbmount.  Note that smbmount has a baroque command
line interface that it would be nice to hide - and one of the beauties
of Unix is the way the uglies of file systems can be encapsulated in
the /etc/fstab file.  It works with NFS; it should work with SMBFS.

 
 
 

Possible to mount Samba filesys (smbfs) via ordinary 'mount' command?

Post by Douglas Bolling » Sun, 20 Jun 1999 04:00:00



Quote:> I have Samba working fine and can mount drives on my 9x/NT boxes from
> Linux using smbmount.  However, it would be nice if it could be done
> using ordinary 'mount', using the normal mount syntax - and,
> eventually, to be done via entries in the /etc/fstab file.

<snip>

I was going to give a go at getting Samba to work with the autofs
demon.  Right now I have things working with a line in rc.local, but
I was hoping for something a big more eloquent.

So I was reading a bit on how to get this to work in the files.  On
my machine, this is at:

/usr/doc/samba-2.0.3/examples/autofs

Here's a snippet from the file:

Quote:> Hi SAMBA developers!
> I have written a shell script that marries smbmount and mount
> on a Linux-machine with a 2.1.55+ kernel (i.e., a newer developper
> kernel.  Especially it makes smbmount compatible
> with autofs!  Now, You (when root :-) can say
>        mount -t smb /win-machine/my-share /mntpt
> Concerning the management of the user/password-pairs I have already
> made a step in the right direction, but there is still a lot of
> brain-work to do :-(

Does this sound helpful to you?  Note that this is still on my "to
do" list, so I don't know how well this works.

--
Douglas Bollinger
Mt. Holly Springs, PA   17065

My other computer runs Linux.

 
 
 

Possible to mount Samba filesys (smbfs) via ordinary 'mount' command?

Post by Kenny McCorma » Sun, 20 Jun 1999 04:00:00




><snip>

>I was going to give a go at getting Samba to work with the autofs
>demon.  Right now I have things working with a line in rc.local, but
>I was hoping for something a big more eloquent.

>So I was reading a bit on how to get this to work in the files.  On
>my machine, this is at:

>/usr/doc/samba-2.0.3/examples/autofs
....
>Does this sound helpful to you?  Note that this is still on my "to
>do" list, so I don't know how well this works.

Yes - this is what I am looking for.  I am still running samba-1.9.18p10,
and a 2.0.3x kernel, so I don't have the file you mention above on my
system.  Anyway, keep me posted on how this works out - it sounds on-target.
 
 
 

1. Apache not serving from CIFS-mounted share, works if it's mounted as SMBFS

I'd like to mount a windows 2000 server fileshare on an linux/apache
server to do some basic web serving. The web server works fine and
shows other content that's stored locally just fine.

This works:
 mount -t smbfs -o username=smbusername,uid=apache,ro //server/share
mountpoint/
but it complains that smbfs is deprecated and I should be using cifs.
For now, I'm using it anyway.

This seems to work:
 mount.cifs //server/share mountpoint/ -
ouser=smbusername,uid=apache,ro
but it won't serve actual files. It allows browsing of the directories
and shows the filenames. It does not return an error, it just does not
send the file. I have confirmed that user 'apache' can read the file
by logging in as that user and viewing the file.

I tried a telnet test, using GET and Host commands captured from
firefox's LiveHTTPHeaders extension, like this:
-=-
 telnet webserver 80
 GET /directory/filename.jpg HTTP/1.1
 Host: webserver
-=-

The result looks like this:
-=-
 HTTP/1.x 200 OK
 Date: Tue, 11 Mar 2008 15:51:07 GMT
 Server: Apache/2.2.4 (Unix) PHP/5.2.0
 Last-Modified: Thu, 21 Feb 2008 16:07:30 GMT
 Etag: "420f8a5-180bf4-4d7a7480"
 Accept-Ranges: bytes
 Content-Length: 1575924
 Keep-Alive: timeout=5, max=100
 Connection: Keep-Alive
 Content-Type: image/jpeg

 Connection to host lost.
-=-

2. kswapd using a lot of CPU

3. Samba/smbfs, ncpfs -- works, but can't figure out how to mount

4. How to change NIC?

5. mount.smbfs : 'Bad adress'...

6. Quota for Slackware 3.0 Kernel 1.2.13

7. Curious about *BSD History

8. Can't mount smbfs as user (vfs.usermount=1 doesn't work).

9. NFS mount won't mount at boot, but mount -a works fine.

10. Using Samba, smbclient works, but can't mount share via smbmount

11. Samba clients can't see partitions mounted via loop device from image files

12. Mklinux: 'mount' command makes X-windows blank?