# [solved] smbfs/cifs/fstab various problems

## fctk

/EDIT: I changed the title because now problems are different since the change from cifs to smbfs...

/EDIT2: title has been changed again  :Laughing: 

hello,

I have a LAN with two computer:

1) pcA with windows xp; ip: 192.168.1.4

2) pcB with gentoo linux; ip: 192.168.1.2

On pcA I created a shared directory (sharename: emule). My goal is to upload/download to/from that directory staying in front of pcB.

On pcB I recompiled the kernel with CIFS support, then I installed samba and put the following line in /etc/fstab:

```
//192.168.1.4/emule /mnt/emule cifs password= 0 0
```

I can download files from the shared directory without any problem, and I can upload to it small files (up to ~40mb) too. The problem is when trying to upload big files (such as ~700mb): the process becomes very slow and the computer with gentoo dramatically slows down. What could it be?

Some infos:

/etc/samba/smb.conf is an empty file.

/etc/conf.d/domainname:

```
DNSDOMAIN="homenetwork"
```

/etc/hosts:

```
127.0.0.1     localhost

192.168.1.4   computer2.homenetwork computer2

192.168.1.2   thorium.homenetwork thorium
```

emerge -pv samba:

```
[ebuild   R   ] net-fs/samba-3.0.14a-r1  -acl +cups -doc -kerberos -ldap -libclamav -mysql -oav -pam -postgres +python -quotas +readline (-selinux) -winbind -xml +xml2
```

Thanks,

fctkLast edited by fctk on Mon Jul 25, 2005 9:45 pm; edited 5 times in total

----------

## ikshaar

I have some similar issues but no solution sorry.

Just to confirm that it is the same, I noticed few things on my set-up:

- if I drag'n drop a file in Nautilus over the Samba share of the windows PC, the slow down does not occur - compared to copy over mounted share.

- if I transfer another file, to another computer (over NFS for example) but from same Gentoo PC, it speeds up my transfer speed to the Windows share.

I use kernel driver for my Gigabit network card r8169.

The first observation leads me to think that it was my samba mount which was badly configured.. (still possible) but the second observation is very odd and I cannot really make sense of it.

GS-2.6.11-r11; 64bits; samba-3.0.10

Any similar oddities ?

[EDIT] Just realized that your smb.conf was an empty file ... it's not normal. Might be that bug https://bugs.gentoo.org/show_bug.cgi?id=70686 ... althought bug has never been confirmed - and it does not explain the slow down.

----------

## fctk

 *ikshaar wrote:*   

> [EDIT] Just realized that your smb.conf was an empty file ... it's not normal. Might be that bug https://bugs.gentoo.org/show_bug.cgi?id=70686 ... althought bug has never been confirmed - and it does not explain the slow down.

 

mmh... and so what should I put into smb.conf?

----------

## fctk

FIXED! i just have to use smbfs instead of cifs!  :Very Happy: 

now my /etc/fstab line is:

```
//192.168.1.4/emule /mnt/emule smbfs password= 0 0
```

anyway, when my gentoo pc starts, i get the following error:

```
SMB connection failed

Could not mount all network filesystems!
```

despite of this, if i manually mount the shared directory, as such:

```
mount /mnt/emule
```

everything works well.

what could it be?

/EDIT: i compiled smbfs support as module...

/EDIT2: tried not to compile as module, still same error...

----------

## segedunum

 *fctk wrote:*   

> FIXED! i just have to use smbfs instead of cifs! 

 

CIFS kernel support can still be quite flaky, and hasn't been tested as much as the straight SMBFS stuff. Your only hope, provided you haven't done anything out of the ordinary, is to upgrade your kernel. Currently, as far as I know, things like ACL support is still experimental.

 *fctk wrote:*   

> now my /etc/fstab line is:
> 
> ```
> //192.168.1.4/emule /mnt/emule smbfs password= 0 0
> ```
> ...

 

Does it actually mount the filesystem at /mnt/emule regardless?

I would try taking out the 

```
password=
```

 part of your line in fstab.

----------

## fctk

 *segedunum wrote:*   

> CIFS kernel support can still be quite flaky, and hasn't been tested as much as the straight SMBFS stuff. Your only hope, provided you haven't done anything out of the ordinary, is to upgrade your kernel. Currently, as far as I know, things like ACL support is still experimental.

 

i think that my kernel (gentoo-sources-2.6.12-r6) is quite up to date... anyway, what is ACL?

 *segedunum wrote:*   

> Does it actually mount the filesystem at /mnt/emule regardless?

 

no, it doesn't.

 *segedunum wrote:*   

> I would try taking out the 
> 
> ```
> password=
> ```
> ...

 

i tried, and now it asks me for a password at boot; i press [enter] without typing anything, and then i get the same error...

mmh... i'm thinking of putting this line:

```
mount -t smbfs -o password= //192.168.1.4/emule /mnt/emule
```

into /etc/conf.d/local.start... i know it's a workaroud, but it may work...

----------

## fctk

the workaround won't work... i get this error:

```
 * Starting local ...

Error connecting to 192.168.1.4 (Network is unreachable)

8748: Connection to 192.168.1.4 failed

SMB connection failed     [ ok ]
```

but after the login, if i type:

```
mount -t smbfs -o password= //192.168.1.4/emule /mnt/emule
```

it perfectly works! too strange...

/EDIT:

other problem... with smbfs now i can write to the shared directory only from root user... with cifs i could write also from a common user...

----------

## fctk

bump  :Sad: 

----------

## fctk

i found a bug which seems very similar to my problem: https://bugs.gentoo.org/show_bug.cgi?id=82357

/me is thinking about switching back to kernel 2.6.11-r3...

----------

## fctk

i tried kernel gentoo-sources-2.6.11-r4 and uploads with cifs filesystem work! so it's for sure a kernel bug.

however, i tried to measure speed transfers to compare smbfs and cifs, and i discovered cifs is much slower then smbfs. the test file was 318MB:

smbfs | up: 3' 32"; down: 23" | up: 1,5MB/s; down: 13,8MB/s

cifs | up: 7' 52"; down 1' 27" | up: 0,7MB/s; down: 3,6MB/s

since cifs seems quite unstable and slow, i think i will keep kernel 2.6.12 and smbfs...

anyway, i still have 2 problems with smbfs:

- how can i let a common user read/write the shared directory?

- why if i edit fstab for mounting the shared dir, at boot i get an error?

----------

## fctk

 *fctk wrote:*   

> anyway, i still have 2 problems with smbfs:
> 
> - how can i let a common user read/write the shared directory?

 

i read this thread: https://forums.gentoo.org/viewtopic-t-198942.html and i drew the following conclusion:

```
mount //192.168.1.4/emule /mnt/emule -o guest,dmask=777,fmask=777,gid=users,uid=fctk
```

the last problem remains... however i'm going to do some debugging of: /etc/init.d/netmount

p.s. it seems a monologue... :Rolling Eyes: 

----------

## ikshaar

 *fctk wrote:*   

> p.s. it seems a monologue...

 

Well it was the week-end  :Wink: 

For mine I use:

```
//gabor/lacie   /comp/fw        smbfs   umask=000,uid=my_uid,gid=my_gid,credentials=/home/my_name/.smbcredentials      0 0
```

.. with substitution as required. It's mounted at boot time. And ~/.smbcredentials contains:

```
username=my_name

password=my_password_to_windows_machine

```

Not top security of course, but set file read only for yourself.

From the thread I could not figure out or not if you solved speed issue or not ?

 *Quote:*   

> FIXED! i just have to use smbfs instead of cifs! 

 

Using SMBFS solve speed issue ?

----------

## fctk

cifs won't work with kernel 2.6.12. with 2.6.11 it works, but it's much slower then smbfs. if i use smbfs, the speed is ok for my needs.

the only problem now is mounting the shared directory at boot without getting the error i said in a previous post... i think the problem is /etc/init.d/netmount or perhaps the problem could be found if i debug that init script... i'm working on this...  :Cool:  if someone wants to help me he is welcome! my baselayout version is: 1.11.13.

----------

## fctk

FIXED!  :Very Happy: 

it was a stupid thing: you must specify a not-null username among the other options!

after this discovery  :Laughing:  i tried again cifs filesystem and now it works, but it's still slower then smbfs...  :Rolling Eyes: 

so, this is my definitive and working fstab line:

```
//192.168.1.4/emule /mnt/emule smbfs username=fctk,password=,dmask=777,fmask=777,gid=users,uid=fctk 0 0
```

----------

## platojones

 *Quote:*   

> 
> 
> i tried again cifs filesystem and now it works, but it's still slower then smbfs...
> 
> 

 

That's possibly true (never measured the speed, myself), but smbfs has a 2GB file size limit and cifs doesn't.  I've move quite large files across my network sometimes, so smbfs is really an option for me.

----------

