# Building a File and Print Server

## olias2

Greetings:

I want to build a Linux server for sharing files and a printer. Here is my home LAN setup as of now...

- Cable modem, 4 port router and a 5 port switch.

- 4 PC's (2 Linux-Gentoo and 2 WinXP), Xbox and a Laptop(W2k)

I have a spare PC which is a Dell GX1, P2-350 with 256MB of memory and Gentoo set up on a 8GB hard drive. I was planning on putting a second 120GB hard drive in it for user files. I wanted each user to have their own file space as well as access to a shared space for media files. I was also hoping to have a scratch drive here that wipes clean each night. In addition to all this, I wanted to move the laser printer from my Wife's PC to this new server so that the 2 Windows and 2 Linux PC's can all print to it.

Can all this be done with Samba and CUPS or will I need to use NFS as well? Also, where does LISa fit into all this?

I would also appreciate if somebody can point me to any good howto's on this topic.

Thanks for your help, olias

----------

## forumuser1

Use samba for file sharing bu for print sharing avoid samba cups combination. For print sharing use lprng apsfilter.  Lprng and apsfilter is far easy to setup and get going plus it is also more secure.

----------

## olias2

Thanks for the tip on not using cups. I was also wondering, do I need to install anything on the 2 Linux clients? BTW, what is LISa?

olias

----------

## fleed

I never had problems with cups, works very well for me. Of course your experience might be different and if you're used to lprng (coming from redhat, maybe?) then you'd better off sticking to that. In any case, I suggest using cups without samba. Windows clients can print directly to cups so you shouldn't have any problems with that.

----------

## olias2

This is great... I got a WinXP client connected to a shared directory on the Linix machine running Samba. What about a Linux client... how do I connect?

Thanks, Olias

----------

## numerodix

 *olias2 wrote:*   

> Thanks for the tip on not using cups. I was also wondering, do I need to install anything on the 2 Linux clients? BTW, what is LISa?
> 
> 

 

I believe it's a deamon that scans for samba clients/windows shares, once it's running you can browse the shares much like you would in a Windows environment. I've always seen this in KDE but I don't know if it's KDE specific. I do know you can browse the network in Konqueror though, with lisa running.

 *olias2 wrote:*   

> This is great... I got a WinXP client connected to a shared directory on the Linix machine running Samba. What about a Linux client... how do I connect?

 

Well the easiest way is to 

```
mount -t smb //server/share /mount/point
```

----------

## olias2

Thanks numerodix but... 

```
mount: fs type smb not supported by kernel
```

 ...I think I need to re-compile my kernel.

----------

## olias2

Turns out that I had 'smbfs' as a module so I loaded it and still get...

```
mount: fs type smb not supported by kernel
```

 Is there something elese needed?

Thanks again, Olias

----------

## Valhlalla

You could also use nfs for the linux clients.

It certinally seems alot of answers simply post more questions, dosn't it  :Razz: 

----------

## bos_mindwarp

 *olias2 wrote:*   

> This is great... I got a WinXP client connected to a shared directory on the Linix machine running Samba. What about a Linux client... how do I connect?
> 
> Thanks, Olias

 

You need to reconfigure your kernel, somewhere under filesystems->network filesystems enable smbfs (you can ignore those options about locale, I do).

Then you can do:

```

 mount -t smbfs -o username=something,password=something //server/pub /mnt/share

```

----------

## fleed

In case you haven't noticed, olias, the difference is actually to use mount -t smbfs instead of what numerodix had originally said, mount -t smb. Cheers!

----------

## olias2

 *fleed wrote:*   

> In case you haven't noticed, olias, the difference is actually to use mount -t smbfs instead of what numerodix had originally said, mount -t smb. Cheers!

 

Thanks fleed. I now get a different error... 

```

# mount -t smbfs //filesrv/home/olias /mnt/share

mount: wrong fs type, bad option, bad superblock on //filesrv/home/olias,

       or too many mounted file systems
```

Any ideas what I'm missing?

----------

## olias2

<bump>

ne1 want to throw me a bone on why I can't mount this? 

```
# mount -t smbfs //filesrv/home/olias /mnt/share

mount: wrong fs type, bad option, bad superblock on //filesrv/home/olias,

       or too many mounted file systems
```

 I have smbfs loaded as a module. I also tried this method... 

```
mount -t smbfs -o username=something,password=something //server/pub /mnt/share
```

...but got the same results.

thanks, oli

----------

## Telamon

It might be that you don't have the proper hostname.  When you type 

```
ping -c 1 filesrv
```

 do you get a response, or a DNS error (unknown host filesvr)?  The mount command won't do nmbd lookups (at least I don't think) so you have to either have a DNS entry for the server in your /etc/hosts or use the -I option, which would go something like

```
mount -t smbfs -o -I=192.168.1.1 //filesvr/home/user /mnt/dir
```

The hosts fix is much easier.

----------

## olias2

 *Telamon wrote:*   

> It might be that you don't have the proper hostname.  When you type 
> 
> ```
> ping -c 1 filesrv
> ```
> ...

 

Thanks Telamon. I can ping from a WinXP client only. The Linux clients give me an 'unknown host filesvr'. I'm very interested in knowing how to fix this.

thanks, oli

----------

## olias2

This is weird. I can ping my server if I use it's IP address but I can't when I use the server name. Do I need to configure each client with some kind of look-up table?

Ca'mon, give me a clue. <beg>

----------

## pilot

You need to edit your /etc/hosts

```
vi /etc/hosts

```

Then just add the following line, substitute the proper IP in

```
192.168.1.101     filesrv

```

Should be set!   :Very Happy: 

----------

## olias2

thanks, now it works. Its the simple things that make me feel simple.  :Embarassed: 

----------

## olias2

Sorry but I'm dead in the water again. I can ping but can't mount...

```

# mount -t smbfs -o -I=192.168.1.103 //linsrv/home/olias /mnt/share

mount: wrong fs type, bad option, bad superblock on //linsrv/home/olias,

       or too many mounted file systems
```

 Do I need to put an entry in /etc/fstab? This is so much easier in Windows.   :Sad: 

thanks, oli

----------

## compuboy86

1) Use smbmount (less to type, more or less the same thing)

2) What does -I do for you???  I think that is your "bad option"

From the help of smbmount:

 *Quote:*   

> mount -t smbfs -o username=tridge,password=foobar //fjall/test /data/test

 

EDIT:  Also, by using -o you need to actually specify a username (which may be guest)

----------

## olias2

 *olias2 wrote:*   

> <snipped> I was also wondering, do I need to install anything on the 2 Linux clients? <end>
> 
> olias

  Well its too bad no one answered this one because as it turns out I needed to emerge samba on the linux clients.

Hope this helps some other poor sole. But really, I would like to thanks for the replys... it kept me going.

----------

## olias2

Another bit of information on permissions. I had to 'chmod 777 /share' the directory where users could write to. Next mission is to setup the printer.

----------

## CMI

 *olias2 wrote:*   

> Another bit of information on permissions. I had to 'chmod 777 /share' the directory where users could write to. Next mission is to setup the printer.

 

Thats a bit dangerous. You could instead create a group and have the group own the shared directory. Then you could set the directory permissions to 775 and have a bit more control over who has access.

----------

