Brion Vibber's
SMBFS Stuff


mount.smbfs

mount.smbfs is a Perl script that translates mount(8) style option into options for smbmount(8) as in the smbfs package and then runs smbmount. In conjunction with a small patch to mount(8) this script can be used to mount SMB shares on Linux via the normal mounting methods.

Users of Linux kernels 2.1.70+ can use Michael Warfield's script to translate the smbfs-style smbmount options to the new samba-style smbmount options. See his page at http://www.wittsend.com/mhw/smbmount.html.

mount.smbfs is copyright (c) 1998 by Brion Vibber (brion@pobox.com). There is no warranty! Use it at your own risk! The license is GPL 2.0 - see http://www.fsf.org/copyleft/

Version history

Version 1.0 - 5 August 1998

Download & Installation

  1. You can download version 1.0 of mount.smbfs at http://pobox.com/~brion/linux/mountsmbfs-1.0.tar.gz. You'll also want mount 2.8a, which you can get at ftp://ftp.win.tue.nl/pub/linux/util/mount/mount-2.8a.tar.gz.
  2. Find a nice directory and extract the archives:
    % cd /some/dir
    % tar zxvf /download/dir/mountsmbfs-1.0.tar.gz
    ...
    % tar zxvf /download/dir/mount-2.8a.tar.gz
    ...
    % cd mountsmbfs-1.0
    
  3. Edit mount.smbfs in your favorite text editor to make sure that the $smbmount variable points to the actual location of your smbmount program. If you're not sure where it is, run ``which smbmount''.
  4. Copy mount.smbfs to /sbin:
    % cp mount.smbfs /sbin
  5. Apply the patch to mount and compile it:
    % cd ../mount-2.8a
    % patch -p1 < ../mountsmbfs-1.0/mount-2.8a-smbfixes.patch
    ...
    % make
    ...
    
  6. Back up your old mount program just in case and install the new one:
    % mv `which mount` mount.old
    % make install
    ...
    % hash -r
    
  7. Try it out!
    % mount //some_server/some_share /some/directory -o nopwd
    

Usage

You should be able to mount SMB shares in any of the following fashions:

Note that if you for some reason are unable to patch mount, you may still be able to use an older version if you rename mount.smbfs to mount.smb and specify the filesystem type as ``smb'' with the -t option or in /etc/fstab.

Options

The following options (-o option=value,option=value,...) are based on the DOS FAT filesystem options:

These options I made up to give readable names to smbmount's unique options.

How it works

mount can use helper programs called mount.filesystemtype to help it out with filesystems it doesn't know. By default it only does this for types ``smb'' (LAN Manager / Windows) and ``ncp'' (Netware). However, the rest of the world (the kernel and the SMB mounting utilities) know the SMB filesystem as ``smbfs'', and mount doesn't recognize SMB service names of the form //server/service, so you need to specify the wrong name for the filesystem type in order to get mount to touch SMB.

That's where the patch to mount comes in. It adds ``smbfs'' to the list of helpers to check for, so we can use the right name for the filesystem type and it will find and run mount.smbfs. The patch also adds a check for the distinctive double slash and automatically sets the filesystem type to smbfs, so you don't need to explicitly set it on the command line. There is also an addition to the logic for assigning mounts to child processes when doing a forked mount all, but that doesn't seem to work right at the moment.

The mount.smbfs program is called by mount, and translates the options and calls smbmount which performs the actual mounting of the filesystem.

Successes so far!

mount.smbfs and the patch to mount have been tested on two different machines successfully:

Problems


Back to my Linux stuff.
Back to my home page.
Send me e-mail.


Linux NOW! The Linux Documentation Project Homepage Graphics by Gimp