# [SOLVED] mounting windows share

## wharez

Im trying to mount a WinXP shared folder with

```
mount -t smbfs //192.168.0.1/network /mnt/network/
```

but the following error is returned:

```
mount: wrong fs type, bad option, bad superblock on //192.168.0.1/network, or too many filesystems mounted
```

Any suggestions as to what is wrong?Last edited by wharez on Tue Mar 07, 2006 8:27 am; edited 2 times in total

----------

## brims

Someone may have been able to get that to work, in my experiences I could never get anything to connect to an XP share, win2k, linux with samba, nothing.

----------

## lambada

you probably have to give your windows username and password

try:

```

mount -t smbfs -o username=yourwindowsusername,password=yourwindowspassword,uid=linuxuserid,umask=000 //192.168.0.1/network /mnt/network/

```

uid and umask are just for giving you full permissions to the mounted filesystem. If you don't need to write/delete, just remove them.

For a permanent mount you can add it to fstab,

eg:

```

# samba mounts

//192.168.0.1/network       /mnt/network        smbfs           auto,user,username=blah,passwd=blah,uid=blah,umask=000   0 0

```

I could be wrong and it could be something else.

----------

## lambada

Sorry, I was tired and the above might be totally off but I'll leave it there for information.

Try

```

 smbclient -L 192.168.0.1 -U windozeusername

```

It should prompt you for a password if you have one set up and list the services avaliable.

Just remembered having  a similar problem at the begginig. Did you enable samba in your kernel?

CONFIG_SMB_FS=y

CONFIG_SMB_UNIX=y

Sorry for my messy replies. I am quite tired.

----------

## wharez

I did

```
mount -t smbfs -o username=*****,password=****** //192.168.0.1/network /mnt/network/
```

and I still get the same error I posted above.

Any other ideas?

How do I check if samba is enabled in my Kernel, and if not, how do I re-compile it with samba enabled?

----------

## DawgG

have you checked the windoze-logs? one might be surprised, but doze has got some. if u use the teletubbie release (aka XP), make sure that somewhere under workplace->folder options (i'm not sure about the exact location) "simple filesharing" (or "simple network shares"; i'm not sure about the exact name; "einfache dateifreigabe" in german) is UNchecked, create a user+pw and give this one all the necessary perms on the share and ntfs.

on the linux side, make sure that you have the smbmount-program(s) (/usr/bin/smbmount) installed. this is called when you 

```
mount -t smbfs  ... 
```

usually you get them when u install samba. the kernel-option alone DOES NOT PROVIDE it by itself. you can install the whole samba package or there might be standalone progs for this (i don't know since i always use the whole package).

the smbclient also comes with this package. used without any user/pw (just hit enter when asked) it should provide u with some info on the windoze-machine.

and remember to turn off the windoze-"firewall."

i'm sure you'll get it to work in no time.

----------

## 01mf02

You could try to make a Samba server on your Linux machine to check if mounting shares would work principally.

----------

## lambada

I am not sure how you do this if you are using genkernel.

but, in genetal, to check if you have samba enabled in your kernel, open /usr/src/linux/Makefile in your favourite text editor and search for 

CONFIG_SMB_FS and CONFIG_SMB_UNIX 

if it says they are not enabled, edit the lines to look like

CONFIG_SMB_FS=y

CONFIG_SMB_UNIX=y 

Alternatively, go to /usr/src/linux and execute 

```

make menuconfig

```

Then browse to File Systems -> Network File Systems

and enable :

<*> SMB filesystem support

<*> CIFS filesystem support

also go to General Setup -> Local Version and type something there preceded by a dash. In my case it's my name. I will refer to this string as localversion from now on. (eg: -gaga)

Exit, Saving modifications.

Now you are done configuring and you have to make the kernel.

For genkernel I don't know how to do this, you'll have to look around. I am not liable for any blowup.

Now mount your boot partition if it's not already mounted and back up your current kernel:

```

cd /boot

mkdir oldkernel

```

copy everything else in /boot to /boot/oldkernel

Then 

```

cd /usr/src/linux

make && make modules_install

cp arch/i386/boot/bzImage/  /boot/kernel-2.6.15-extraversion-localversion

cp .config /boot/config-2.6.15-extraversion-localversion

cp System.map /boot/System.map-2.6.15-extraversion-localversion

```

where you should replace 2.6.15 with your kernel version and the "extraversion" is in the 4'th line of your /usr/src/linux/Makefile

Backup /boot/grub/menu.lst to something like /boot/grub/menu.lst.old

Now add a new entry in /boot/grub/menu.lst, with the right kernel name. Easiest is to copy paste the old one and replace kernel name, title. Also remove any initrd stuff from this one.

Reboot.

Hope this works for you but be aware that if you are using genkernel (is this the third time) instructions could be majorly different.

Be careful making those changes and have your install cd handy in case somthing goes wrong and you have to boot using the live cd, mount the boot partiton and restore the situation to what it was.

----------

## wharez

Thanks for your help guys. It was a windoze "security" issue. Once I changed some settings, it mounted fine with 

```
mount -t smbfs -o username=*****,password=****** //192.168.0.1/network /mnt/network/
```

Th[/quote]anks again!

----------

## rsa4046

 *wharez wrote:*   

> Thanks for your help guys. It was a windoze "security" issue. Once I changed some settings, it mounted fine with 
> 
> ```
> mount -t smbfs -o username=*****,password=****** //192.168.0.1/network /mnt/network/
> ```
> ...

 Can I ask you which settings in Windows you changed? I'm having a similar problem in XP, in that if I turn the XP firewall DOWN, I get an almost instantaneous response from XP

```
# smbclient -L //achilles

Password:

Domain=[ACHILLES] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Sharename       Type      Comment

        ---------       ----      -------

        IPC$            IPC       Remote IPC

        print$          Disk      Printer Drivers

        SharedDocs      Disk

        Printer3        Printer   hp LaserJet 2300dn PCL 6

        ADMIN$          Disk      Remote Admin

        C$              Disk      Default share

        Printer         Printer   Microsoft Office Document Image Writer

Domain=[ACHILLES] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Server               Comment

        ---------            -------

        Workgroup            Master

        ---------            -------

```

where achilles is the XP machine. However, with the XP firewall UP, I get the following timeout after about 10s:

```
# smbclient -L //achilles

timeout connecting to 192.168.1.102:445

timeout connecting to 192.168.1.102:139

Error connecting to 192.168.1.102 (Operation already in progress)

Connection to achilles failed

```

even though simple file sharing is turned OFF, the "File and Printer Sharing" box is checked, and the "Exceptions" tab specifically includes TCP 139, TCP 445, UDP 137, and UDP 138 (scope = subnet on all), the ports that smbclient fails to connect on. Clearly this is a Windows Firewall issue, does anyone know how to fix it?

Added: I just read somewhere that the XP Firewall blocks SMB traffic by default: is this true?

----------

## rsa4046

Update: Here's the contents of windows firewall log: it seems to show dropped packets (I assume these mean it is blocking that port), even though its settings specifically tell it not to ...

```
2006-03-08 18:39:22 DROP TCP 192.168.1.100 192.168.1.102 55859 445 60 S 4054609030 0 5840 - - - RECEIVE

2006-03-08 18:39:25 DROP TCP 192.168.1.100 192.168.1.102 55859 445 60 S 4054609030 0 5840 - - - RECEIVE

2006-03-08 18:39:31 DROP TCP 192.168.1.100 192.168.1.102 55859 445 60 S 4054609030 0 5840 - - - RECEIVE

2006-03-08 18:39:39 DROP TCP 192.168.1.100 192.168.1.102 56130 139 60 S 4076732235 0 5840 - - - RECEIVE

2006-03-08 18:39:42 DROP TCP 192.168.1.100 192.168.1.102 56130 139 60 S 4076732235 0 5840 - - - RECEIVE

2006-03-08 18:39:48 DROP TCP 192.168.1.100 192.168.1.102 56130 139 60 S 4076732235 0 5840 - - - RECEIVE

```

192.168.1.100 is the linux box, 192.168.1.102 the XP box. I also tried this on XP cmd line:

```
netsh firewall set portopening tcp 445 smb enable
```

but again to no avail. I'm beginning to feel this is a waste of time, per brims' post above.

----------

## rsa4046

Ok, despite less that vigorous response to my previous post, I thought I would post what I did to solve this problem anyway, although it may be trivial to most. If the winXP PC whose shares you're trying to see from gentoo has a static IP, you can enable sharing without disabling the firewall by changing the scope of the firewall's 'File and Print Sharing' ports. The default is subnet (which seems like it should work on a LAN, but doesn't). So go to Control Panel|Firewall|Exceptions tab|check 'File and Printer Sharing' box, and change scope of TCP 139 and TCP 445 (probably just the first is sufficient) to a custom list that includes at least the gentoo box's IP (or the range of IPs to which you wish to grant access). This seems to permits sharing of default shares (C$, SharedDocs, etc.). Hope this helps somebody. Cheers --

----------

## Larcen

 *rsa4046 wrote:*   

> 
> 
> ```
> # smbclient -L //achilles
> 
> ...

 

I get a very similar error no matter what kind of share I try to mount. Be it command line or fstab, my error like that comes if I try to mount a Windows share or a Samba share from another Gentoo box inside my LAN.  I can browse from Windows to said Gentoo Boxes with ease, but not from Gentoo to any other shares. Even if I try navigating from Nautalis' smb://WORKGROUP/ It shows the shares, but when I try to move forward from there I get a 'Contents could not be displayed' error. Anyone have any insight I've missed over the past 3 days of frustration?

---EDIT---

Correction. I can mount Windows shares on Windows Machines in fstab and browse with smbclient, but I can't browse from one Gentoo box to the other without the timeout error. Same still stands however for the Nautalis browsing error.

----------

