# SAMBA: Linux to Linux networking? & NFS

## Qweasda

I was wondering, is it possible to network a Linux PC to a Linux PC with Samba or only Linux to Windows? From the docs it seems only Linux to Windows but it doesn't clearly say that. Am I wrong?

If it can't, can NFS do it? What's the NFS hme page, I can't sseem to find it?

Thanks!

----------

## Dathon

Absolutely it's possible.   I did it just today between a  RH 6.2 box  and my Gentoo server.  I used this to mount the entire /root directory off of Gentoo on the RH box and then backed it all up to 4mm tape.

Samba needs to be running on both machines (obviously) and I'll assume you have all the authentication worked out on both machines.  Also, you'll have to have your source "share" configured properly in smb.conf. 

In this case "redhat" is my source machine (remote) and I am mouting the directory "myfiles" on the local machine over mount point "/home/myfiles"

On the local machine do:

```

/bin/mount -t smbfs //redhat/home/myfiles /home/myfiles -o username=root%password

```

Do a `df` and enjoy!

----------

## S_aIN_t

nfs is used to share stuff between *nix.. so if you just sharing stuff between linux distros it is very easy to set up nfs server and client.. 

read the nfs howto... http://nfs.sourceforge.net/nfs-howto/ that is how i got it working.

----------

## Qweasda

Cool, thanks guys. I'll try setting up Samba Linux to Linux (as well as to my Windows boxes which are already setup!)

I'm building Samba on a 200mhz 48mb comp right now..SLOOOW.

----------

## Qweasda

Okay I got Samba set up, can see both my Linux boxes and WIndows box! But, how do I get the server to start on system startup in Slackware 8.1? In Gentoo I just did 'rc-update add samba default' and it worked on boot up, Slackware doesn't have that funcion.

In the docs it says to add:

netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd

netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd

to the /etc/inetd.conf file. I did that but it doesn't launch on start.

Please help, thanks.

----------

## mr_neutron

Well, you only need Samba running on the machine with the directories you want to share. If this is your gentoo box and you have Samba running, all you have to do is

```
smbmount //<gentoo box>/<share> /<local mountpoint>
```

on your Slackware box. No need to have a Samba server running here.

----------

## thinair

would it be better to use NFS, or not and why ?

I actually use samba between my two gentoo server and it work well...

--

thinair

----------

## Dathon

Glad the samba solution worked.  I know in the days before smb, the *only* way to do this was via an NFS-mount.  Knowing that and having a need to do a remote mount,  I started looking at what I had to do to install and configure NFS.  But the more I looked at it the more it seemed there was a *lot* of setup and configuration  to make NFS work.

Since smb was already up and running I thought it would be great to take advantage of it.  I'm definitely for NFS if there are any know limitations on using samba to do the remote mounts or if there are other benefits to using NFS.  

Thanks to all for your personal  experience on this!

----------

## mr_neutron

 *thinair wrote:*   

> would it be better to use NFS, or not and why ?

 

NFS is a lot easyer to set up, but it is "UNIX only". If you want your shares to be accesible from Windows, you have to use Samba.

----------

## thinair

I know that's it UNIX only... but does'it provide other feature... 

advantage or disadvantage ? except to be a lot easyer to set up...

----------

## OdinsDream

 *Dathon wrote:*   

> 
> 
> ...  But the more I looked at it the more it seemed there was a *lot* of setup and configuration  to make NFS work.
> 
> ...
> ...

 

I'm not sure what you mean by lots to set up. I was using the program "dvdrip" recently to encode some dvd discs, and I noticed it had an option to run in "cluster mode", where many linux machines would share the work of encoding the movie (typically a multi-hour process). 

The instructions for this required that I export an NFS directory and mount it on all the nodes I wished to use. I had never used NFS before this point. To get it working, I did:

emerge nfs-utils

nano /etc/exports

/etc/init.d/portmap start

/etc/init.d/nfs start

My /etc/exports file looks like this:

```

/home/odinsdream        192.168.2.2(rw)

```

Which means, share "/home/odinsdream" with only that specific IP address, in read-write mode.

On the other side of things, in the client, I modified /etc/fstab to reflect this newly-available resource:

```

192.168.2.1:/home/odinsdream       /home/odinsdream/p2c2e      nfs

```

...which means, mount that share, located at that IP address, and place it in the local filesystem at "/home/odinsdream/p2c2e"

Note that I just have the same username on both systems. Those paths do not need to be identical, or even similar.

The only tricky part to this setup was starting portmap, which doesn't get started before nfs automatically, even though it should. I found that tip in a thread on this board. Good luck with your task. NFS was a pleasure to use.

----------

## Qweasda

Okay got it, thanks.

But I still don't know how to get Samba to start on bootup in my Slackware box.

----------

## OdinsDream

 *Qweasda wrote:*   

> Okay got it, thanks.
> 
> But I still don't know how to get Samba to start on bootup in my Slackware box.

 

Slackware?

Is there an init.d script equivalent?

----------

## Qweasda

There's an /etc/inetd.conf file, which I added those lines the docs said to add (posted above) but it still doesn't lanch on bootup.

----------

## PowerFactor

 *Qweasda wrote:*   

> There's an /etc/inetd.conf file, which I added those lines the docs said to add (posted above) but it still doesn't lanch on bootup.

 

That won't launch it on start. inetd only launches a server when it gets a request.

----------

## clockwise

one thing i found out when i was trying to use a samba mount for my /var/tmp/portage compiling was that you cannot do symlinks over samba. i think permissions are a bit fiddly as well. i think, if you want the network drive to integrate with parts of gentoo then use nfs... if you're just mounting mp3's or movies then go with samba.

----------

## r0nster

 *Qweasda wrote:*   

> Okay got it, thanks.
> 
> But I still don't know how to get Samba to start on bootup in my Slackware box.

 

Hmm,

It's been a while since I used slack but the way Slack did it (I ran 7.1)

It called a special script. 

Slack used a bunch of rc scripts all (or most) poked in /etc/rc.d. In that directory lies rc.inet1 (first network script) and rc.inet2 (starts network services I believe eg. apache, samba, nfs, and so on)

Take a look at rc.inet2 and if you installed the samba.tgz package, there should be an rc.samba or equivalent. rc.inet2 calls the rc.samba sript if it's there which in turn, rc.samba starts (stops) /usr/sbin/smbd (and nmbd)

To make a long story short, check out your /etc/rc.d directory on your slack box and check out rc.inet1 and 2 and check the presence of rc.samba, or whatever its named  :Smile: 

Cheers,

----------

## waverider202

samba is generally slower than nfs, but has some really nice password controls and encryption.  Nfs is built on portmap, so there are some security issues.  If you are on a private network, then nfs is fine, but if you are on the internet, make sure you block nfs from the internet, samba isn't supposed to be on the internet, but I put it there so I can get files from any computer on campus.  So, if security is a concern, use samba.

----------

## Dathon

 *Quote:*   

> 
> 
> I'm not sure what you mean by lots to set up. I was using the program "dvdrip" recently to encode some dvd discs, and I noticed it had an option to run in "cluster mode", where many linux machines would share the work of encoding the movie (typically a multi-hour process).
> 
> The instructions for this required that I export an NFS directory and mount it on all the nodes I wished to use. I had never used NFS before this point. To get it working, I did:
> ...

 

I was unaware of NFS being this easy to use as I had just looked at the generic NFS HOW-TO doc and really didn't know which specific packages to emerge.  Since Samba was working it seemed to make sense, but I will definitely try your steps and use NFS in those cases' where Samba will not work.  I read some place that smbmount only works between linux<--> linux, so an NFS mount would need to be a must-have option anyway.  I also work in an AIX environment so I'm anxious to test this there.

Thanks for the "schooling".

----------

## waverider202

smbmount can mount any smb share, and and smb client can mount any share from samba.  SMB (Server Message Block), is a protocol, so any SMB client can mount any SMB server.  Lots of companies actually use a linux machine running samba as a cheap fileserver for windows machines

----------

