User's Manual

Installing OS-9 Samba File Manager
Using OS-9 Samba File Manager
The smbmount utility
Useful scripts

Installing OS-9 Samba FM
Installation is simple. Just unpack the given archive into directory you like using unzip utility. If you don't have it, download it for free from the os9archive.
[Back to top]

Using Samba FM
You need to load the following modules into memory:
  • samba - file manager code
  • smbprint - simple print client code
  • smbdrv - driver code
  • smbagnt - helper process code (if using agent mode)
  • smbmount - the special mount utility
To do this, change your current data directory to where they reside and issue the following command:
load -d samba smbdrv smbmount smbprint smbagnt

[Back to top]

The smbmount utility
Because the SMB protocol requires some authentication information, the standard OS-9/NFS mount program cannot be used. Instead the special smbmount utility is supplied.

smbmount Mount/unmount remote Samba file system
Syntax: smbmount [</mount-point>] [<resource>] {[opts]}

Function: mount/unmount remote Samba file system, or display current mount information.


Netbios name of client, should be used when Netbios names and hostnames differ and the server refuses login with the default value for the Netbios name which is your hostname.

Hostname/IP address of the server, should be used when Netbios names and hostnames differ on the server. This sets the hostname to contact on the network, the Netbios name of the server still precedes the service name.

If the user name your server administrator gave to you differs from your OS-9 based user name, you should use -U to tell the server about your server's user name. Instead default value from environment variable USER is used.

You may want to give the password required by the server on the command line. You should be careful to use passwords in scripts. If neither -n nor -P are given, smbmount prompts for a password. This makes it difficult to use smbmount in scripts running in batch mode.

Set the domain name to join to.

By default, passwords are converted to uppercase before they are sent to the server, because most servers require this. You can turn off this conversion by using this option.

Should be given to mount resources which do not require a password to log in.

Unmount previously mounted resource. Only super-user (with uid 0.0) or user who mounted the resource can unmount it (only mount-point argument required).

Display information about mounted device - device name (mount-point), IP address of the server, resource type (Disk, Printer, Interprocess Communication Link), and the full name of the resource (only moint-point argument required).

Set directory cache size (512 by default). If you got E$NoTask error code when working with mounted Samba volume, try to increase this value. Do not use here a very large number to minimize memory usage.

Set maximum number of files per a directory (200 by default). If the actual number of files in a directory exceeds this value, the rest of the directory will be skipped without any error. This is a good practice to set it to about 40% of the directory cache size.

Synchronize clock with Samba server

Connect to IPC$ share

Connect to printer share

Set maximal count of simultaneous requests which can be sent to the server at one time (default is 2). This value is server dependent. Windows NT supports up to 50 request, other versions of Windows - 2 at one time. Any how, in the current version you cannot set this value above 8 to save memory.

    -K=keep-alive-timeout (minutes)
Change keep-alive timeout to prevent disconnects on some server configurations. The default value is about 14 minutes, which sometimes can be too big.

    -b=transfer buffer size (bytes)
Change initial transfer buffer size. The default value is 8192 bytes.

Start helper process in the agent mode - as a separate system process instead of an internal thread.

Use SMB packet signing (required by Microsoft Windows Server 2003).

  • 0x02
    Windows 95/98 has well known bug returning invalid date/time values for directory listings. In many cases OS-9 Samba File Manager automatically determines when this trick have to be used.
  • 0x04
    Don't fix Microware's free utility bug for large volumes.
  • 0x08
    Don't use large block transfers (Version I only).
  • 0x20
    Try to handle Windows 95 bug on directory reading (use only if OS-9 dir command sporadically returns E_NOCHLD error).

These options may be reiterated in the command line, or concatenated together. For example, the following lines
   smbmount /pc /server/share -O=2 -O=10 -U=lev
   smbmount /pc /server/share -O=12 -U=lev
are identical.

Be quiet

Not fully implemented yet.

mount-point    is the device name you want to mount the filesystem over. It's the same as in the normal OS-9/NFS mount command.

resource    is the name of the service you want to use on the server. It takes the form //server/service%user - where server is the name of the Samba server offering the desired service, service is the name of the service offered, and user means user name as in -U option. Thus to connect to the root directory until the service "Disk_C" on the Samba server "NT", you would use the following resource name:

To make smbmount more friendly, only one leading '/' is required. The %user part can be also omitted.

Currently smbmount uses gethostbyname() to find the IP address of the desired host. It is thus not really compatible with Samba conventions, where the Netbios name of the server is not necessarily the same as the hostname. In environments which enforce a Netbios name that's different than the hostname, you should use -I and -c to simulate appropriate behaviour.

The example session can look like this:

** -------------------------------------
** Mount remote resource to device pc0
** Display directory for that tree
** Display a C source file
** Copy remote file onto local device
** Change the current working directory
** 	to be inside the mounted volume
** Unmount device
** Mount remote printer (empty password)
** Print file
** -------------------------------------

smbmount /pc0 /server/resource -P=pword
dir /pc0 -e
list /pc0/file.c
copy /pc0/file.c /h0/file2.c
chd /pc0/some_dir
smbmount /pc0 -u
smbmount /lp0 /server/laser -p -n
list sometext.c>/lp0

[Back to top]

Useful scripts
Samba servers support such concept as "browsing" available resources. Any client can view resource names server supplies to all outside world. OS-9 Samba File Manager installation archive includes a small Microware's mshell script smbview implementing this feature. It accepts only one command line argument - server name (except if the server is running Windows NT and the server administrator has closed guest account with a password - you also must supply your password as a second argument) and displays all available resources on given server.

smbstat script walks through all mounted Samba devices and displays mount information as smbmount -i does.

smbsetime script syncronizes your computer's clock with the shared clock on given Samba server. Server name is required as command line argument.

smbjobs script displays remote print job list. Server name and printer name (its share name) are required as command line arguments.

smbpasswd script changes user password on the Windows NT server. Take into account, because this feature is based on Windows NT domain technology, the password should be changed on the Primary Domain Controller (PDC) of your network, not on the server you have access for resources on (consult with your network administrator in case of troubles). Server name (PDC name) should be the first command line argument. The second argument includes user name, old and new passwords and must have the form


Note:  these scripts are not completely functional programs for daily application and use. They were written in the assumption, that will be used only as the simple examples for more best understanding of the OS-9 Samba File Manager internal structures and hidden features.

[Back to top]