create new tag
, view all tags
See AboutThesePages.

There is more than one way to mount a Samba partition (or mount a shared drive from a Windows machine on a Linux machine).


Use smbmount (as root)

All of the following worked, but note:

  • the "-o" (for options) is important! Multiple options must be separated with commas (without spaces).
  • The password must be quoted when it includes certain non-alphanumeric characters.
  • Under the su -c form, you will be prompted for the root password.
  • If you leave out the share password, you will be prompted for both passwords. Not sure which first.

smbmount  //Living2/Mail /home/dad/Mail -o  password='aaaaaaaa' 
smbmount  //Living2/Mail /home/dad/Mail -o  password="aaaaaaaa"   


su -c "smbmount //Living2/Mail /home/dad/Mail -o password=aaaaaaaa"
su -c "smbmount //Living2/Mail /home/dad/Mail -o password='aaaaaaaa'"
su -c 'smbmount //Living2/Mail /home/dad/Mail -o password="aaaaaaaa"'


su -c 'smbmount //Living2/Mail /home/dad/Mail -o password="aaaaaaaa",uid=dad,dmask=777,fmask=777' 

ls -o /home/dad/Mail 
ls Mail

umount  /home/dad/Mail
umount Mail
su -c "umount /home/dad/Mail"

Add to fstab, and (see fstab)

//Office6/K /mnt/Office6_K smb uid=dad,dmask=777,fmask=777,password=xxxxxxxx 0 0

 _service__mount point___type______________options________________________0_0

The last two are normally 0 for all but the main disk partition.

If you leave the password out (entirely), you will be prompted when you manually mount the device using mount. (I don't know what happens during a boot -- I'll leave the password out and find out.)

Although I don't think the order of the options should matter, it seems that if the password includes certain special characters, the password must be the last option -- all options specified after the password seem to be ignored.

mstab shows which devices are mounted.

Mount automatically during boot

Mount manually using mount (see mount)



[dad@System8 dad]$ su -c "smbmount '//Office2/OFFICE_D' '/home/dad/Mail' password='xxx&xxx'"


tree connect failed: ERRSRV - ERRinvnetname (Invalid network name in tree connect.)

SMB connection failed

[dad@System8 dad]$ smbmount --help
Usage: mount.smbfs service mountpoint [-o options,...]
Version 2.0.7
      username=<arg>                  SMB username
      password=<arg>                  SMB password
      netbiosname=<arg>               source NetBIOS name
      uid=<arg>                       mount uid or username
      gid=<arg>                       mount gid or groupname
      port=<arg>                      remote SMB port number
      fmask=<arg>                     file umask
      dmask=<arg>                     directory umask
      debug=<arg>                     debug level
      ip=<arg>                        destination host or IP address
      workgroup=<arg>                 workgroup on destination
      sockopt=<arg>                   TCP socket options
      scope=<arg>                     NetBIOS scope
      guest                           don't prompt for a password
      ro                              mount read-only
      rw                              mount read-write
This command is designed to be run from within /bin/mount by giving
the option '-t smbfs'. For example:
  mount -t smbfs -o username=tridge,password=foobar //fjall/test /data/test  

-- RandyKramer - 11 Jun 2001
(transferred from swiki)

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2002-02-05 - RandyKramer
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look