# mount samba network shares

## digitalsy

Hey, 

I usually download samba for the samba tools such as smbclient and the capabilities to mount network samba shares. Do I really need to download the whole samba server just for these tools? All i really want to be able to do is mount shares, view shares, etc... on my other samba server, not to install the server on this comp, if it's not necessary....unless getting the whole samba package is the only way *shrugs*

-digi

----------

## prolific

Hmm..  try doing this command and see if it works..

mount -t smbfs //ipaddress/sharename /mnt/smbmountpoint

You will have to have smb support compiled into your kernel or loaded as an module.. Im almost certain that you don't need to have samba installed to just mount shares.. However, I have been wrong before.   :Laughing: 

----------

## digitalsy

Ok, I will check my kernel (although i compiled it 4 times because i kept forgetting things, lol...so i SHOULD have it...lest i do it a 5th time) either that or a module.

Thanks, good idea, i figured installing samba was kind of unecessary...

-digi

----------

## digitalsy

Well i added in the smbfs module, and now i tried running mount -t //192.168.1.21/ftp-incoming /home/digitalsy/Archive and i get the following error:

mount: wrong fs type, bad option, bad superblock on //192.168.1.21/ftp-incoming, or too many mounted file systems

I'm thinking i'm gonna need to emerge samba...sigh

----------

## steveb

 *digitalsy wrote:*   

> Well i added in the smbfs module, and now i tried running mount -t //192.168.1.21/ftp-incoming /home/digitalsy/Archive and i get the following error:
> 
> mount: wrong fs type, bad option, bad superblock on //192.168.1.21/ftp-incoming, or too many mounted file systems
> 
> I'm thinking i'm gonna need to emerge samba...sigh

 

yes! you need samba to be able to mount smb shares.

btw: the command should be mount -t smbfs //192.168.1.21/ftp-incoming /home/digitalsy/Archive

cheers

SteveB

----------

## digitalsy

oops yea, i did use mount -t smbfs on my command line, i just typo'd in here. my bad =)

grumble...off to emerge samba...

thx  :Smile: 

----------

## Ian

on the topic of mounting samba shares, i found an interesting problem on my computer...

i added a line to fstab, so it'd mount on boot.  it doesn't mount on boot though, just says it can't mount at this time.  try a mount command in a VT, i get a bad password/username error.  try to mount through a gnome terminal (after i su it) and it works without a hitch.

it's kind of annoying, as it can only mount when in gnome.  i don't have any other wms to try this with, but if anyone has any ideas or solutions, please help :p.

----------

## steveb

 *Ian wrote:*   

> on the topic of mounting samba shares, i found an interesting problem on my computer...
> 
> i added a line to fstab, so it'd mount on boot.  it doesn't mount on boot though, just says it can't mount at this time.  try a mount command in a VT, i get a bad password/username error.  try to mount through a gnome terminal (after i su it) and it works without a hitch.
> 
> it's kind of annoying, as it can only mount when in gnome.  i don't have any other wms to try this with, but if anyone has any ideas or solutions, please help :p.

 

try something like this (you need to change the entries inbetween < and >):

```
//<ip-address>/<sharename>         /mnt/<localmountpoint>     smbfs           rw,users,exec,uid=<local_user_uid>,gid=<local_user_gid>,dmask=777,fmask=777,workgroup=<windows_workgroup>,username=<windows_user_name>,password=<windows_user_password>      0 0
```

cheers

SteveB

----------

## Ian

i have a line almost exactly like that, in fstab, and it works, cause when i do a "mount /mnt/<mount point> it works, but ONLY while in X.  if i do that from CLI, it doesn't work (I can't get the exact error, but something about a bad password).  so, i know my fstab line works, otherwise the mount /mnt/<mount point> command wouldn't work anywhere.

----------

## S_aIN_t

i use this command to mount samba shares.

```

smbmount  \\NameOfOtherComputer\SomeSharedDir mydir\anotherdir

```

at the same time, i use this to unmount

```

smbumount mydir\anotherdir

```

----------

## steveb

 *S_aIN_t wrote:*   

> i use this command to mount samba shares.
> 
> ```
> 
> smbmount  \\NameOfOtherComputer\SomeSharedDir mydir\anotherdir
> ...

 

in fstab?

----------

## S_aIN_t

 *steveb wrote:*   

>  *S_aIN_t wrote:*   i use this command to mount samba shares.
> 
> ```
> 
> smbmount  \\NameOfOtherComputer\SomeSharedDir mydir\anotherdir
> ...

 

no... just from the shell as a regular user.

----------

## Ian

yeah, i'm trying to get it to mount at boot, cause that way i can log into the computer, start up X, start up XMMS, and start playing my MP3s.  i know typing "mount /mnt/gen" isn't a whole lot more, but it's an extra step that i shouldn't have to do :p.

----------

## Moonlit_Knight

Here's what I have in my fstab.. works like a champ everytime:

```

//servername/public   /mnt/public   smbfs      credentials=/etc/server.credentials,rw,umask=000   0 0

//servername/mp3      /mnt/mp3   smbfs      credentials=/etc/server.credentials,rw,umask=000   0 0

```

I'm pretty sure the umask is wrong, or the rw is wrong.. I haven't had time to experiment.  But, the important part is the credentials file.  I have it set up as read/write for root user only.  The contents are:

```

username=

password=

```

(obvious details left out  :Smile:  )

This works very well.  The SMB shares mount automatically, and if I reboot my Windows server, they just come back automagically.  (If I'm using XMMS at the time of the reboot, the music will go away, and then just start playing again when the Windows machine is back up).

Moonlit Knight

----------

## Ian

i know, my fstab line is perfectly fine, that's not the problem otherwise it wouldnt' work at all.

my problem is, it seems i can only mount the share from within X, not from console.  i have no idea why either, and that's what i'm trying to figure out.

----------

