Jump to content

Creating a File and Print Server


ichase

Recommended Posts

Greetings all, as the Topic Title states, I am in the process of creating a File and Print Server out of an old Compaq Presario Desktop.

This desktop has a small hard drive on it and I installed FreeNAS a free Network-Attached Storage operating systems based on FreeBSD. I have an external hard drive that I want to use for the storage. I created a directory to mount /mnt/usb/ and when I attempt to mount the external hard drive which FreeNAS sees as da4 I get "Operation not supported by device"

 

So at this point, maybe this is not going to work out. BUT, I do know that you can install a Linux OS and turn that into a server using SAMBA but what is the best route for me to go in doing this. IE, what would be the best distro of Linux to create a file and print server?

 

In Googling, I read that Ubuntu Server could be a good option but wanted the opinions of those I trust the most. The members of BATL :)

 

Thanks in advance for your always trusted and respected advice.

 

Ian

Link to comment
Share on other sites

securitybreach

Well NFS would be your best option for file serving and CUPS for network printing. As long as you have a cups server on your network, you can easily print from any machine on your network.

Link to comment
Share on other sites

Good Points Josh, I decided to load and did, Ubuntu Server 12.04 for 2 reasons. 1. I need to learn SAMBA and 2. SAMBA's smb.comf covers both the file server and print server settings. Now I am just at the point of doing A LOT of reading to learn how to set the conf file up and learn the ins and outs of SAMBA. I may need to go with another external as the one I tried with FreeNAS still won't mount. Strange.

Any one here real good with SAMBA? If so, I may be asking lots of questions. :)

Edited by ichase
Link to comment
Share on other sites

securitybreach

Why do you want to use Samba over NFS? Do you have many window's PCs on your network?

 

The reason I ask is because Samba was mainly designed to let Window's machines communicate with other OSs (Linux/Unix/OSX) using the SMB protocol. On the other hand, NFS(and CUPS) use native Linux protocols (open standard network file sharing protocol) and will give you higher performance than SAMBA will.

 

Window's machines can connect to NFS shares as well. If you are using Windows, you need to enable the "Services for NFS" which is located at "Control Panel" --> "Programs and features" (or Add/Remove on XP) --> "Turn Windows features on and off" --> Services for NFS. Then activate both "Administrative tools" and "Client" under "Service for NFS".

 

I understand if you want all in one solution, then SAMBA may be a better solution but I would advise that you instead use NFS/CUPS. In my experiences; it is much faster, easier to setup and more stable than SAMBA. Of course, I have not used SAMBA in years but have setup NFS quite a few times over the years so I am a bit partial. Plus another good reason to use NFS/CUPS over SMB is that SMB is a closed protocol and NFS/CUPS are open protocols.

 

Also, SAMBA is available on all distros so why did you not simply install Archlinux (what you are more comfortable with) rather than Ubuntu? https://wiki.archlin...index.php/Samba

  • Like 1
Link to comment
Share on other sites

Guessing here that FreeNAS wants to do its own partitioning & format on your external disk? I played with that in years past, and that is my recollection of how it worked. What filesystem is on the external disk? If it's NTFS that might be the issue.

 

I run samba on my linux distros, and I keep telling myself I will investigate nfs. But re slowness, I think that it only has to be fast enough to keep the network pipe full, easy enough on my 100b lan, the slowest hard disk is faster than that. My only hard complaint about samba is that it sometimes takes a long time for a client to appear on the net [i.e., visible to network neighborhood or smb4k] -- but any box can be mounted immediately in my experience by using mount.cifs. On a client you might say ...

 

#mkdir /mnt/samba

#mount.cifs //192.168.1.105/share /mnt/samba

 

after which I can read/write to filesystems under /mnt/samba. "Share" is the subdir on the server that you've elected to let others use. For my purposes I simply share /mnt, where all partitions on the server box are mounted.

 

Mounting from a windows client is almost the same, except using backslashes instead of forward.

 

I especially like Slax for offhand jobs like this. Have made a slax cd that I can stick into any box, cycle the power and walk away; the cd boots-up slax, loads samba, gets an IP from the router, after which all partitions on the box are available for mounting over the net. In this config the Compac would not need an OS on the hard disk. You could add a TightVNC server module if you need to do remote administration on the box.

Link to comment
Share on other sites

As I expected and why I made this post is because I know the members of BATL will provide me much food for thought. Has anyone told all of you lately what a great group of guys and gals you all are?? :thumbsup:

 

This is a learning experience for me. In my "actual" job, I work a lot with pre-existing servers that are set up through either XP Pro or Windows Server 2003 or 2008 depending on the Ship I am on. But in order to move forward in my learning, I need to know the ins and outs of setting up a server. Going through the motions of hands on experience so I can one day speak educated about Networks and how to set them up and be very comfortable in doing so.

 

To answer your question Josh, yes. I have my work laptop that runs Windows 7, my wife who refuses to entertain using Linux has Windows 7 on her Netbook and I also run XP on 2 VMs on my work laptop (more work stuff)

 

I have a large (did I mention LARGE) Dell tower that will house about 4 hard drives. It's an older box that supports IDE vice SATA and I have PLENTY of IDE hard drives just waiting for the opportunity to get back in a computer and start working. So this weekend, I am going to build the Dell box up and go from there.

 

Another good point you make Josh, is just installing Arch Linux on it and installing either SAMBA or NFS/Cups to set up the server. I know a lot of servers out there are running Linux with SAMBA so that was kind of my thought process in learning SAMBA.

 

Burninbush, yes, my plan is to be able to unplug the monitor, keyboard, and mouse from this tower, tuck it away in a cool place and take care of everything remotely. I have read up on many options to perform this from openSSH to Webmin (there are plenty of options out there)

 

In a nutshell, Ian has a LONG way to go to get to a point where I can file share and print from ANY computer in the house not to mention be able to speak with an educated voice about it. :hysterical: But with that being said, I LOVE THIS STUFF!!!! So it will be a journey with no doubt some fustration but also some FUN as well. :thumbsup:

 

As always, thank you for taking the time to respond to my post and offer me options and guidance.

  • Like 1
Link to comment
Share on other sites

Why do you want to use Samba over NFS? Do you have many window's PCs on your network?

 

The reason I ask is because Samba was mainly designed to let Window's machines communicate with other OSs (Linux/Unix/OSX) using the SMB protocol. On the other hand, NFS(and CUPS) use native Linux protocols (open standard network file sharing protocol) and will give you higher performance than SAMBA will.

 

Window's machines can connect to NFS shares as well. If you are using Windows, you need to enable the "Services for NFS" which is located at "Control Panel" --> "Programs and features" (or Add/Remove on XP) --> "Turn Windows features on and off" --> Services for NFS. Then activate both "Administrative tools" and "Client" under "Service for NFS".

[...]

Is this why I couldn't get W8 to talk to a linux based NAS? Also, could not find this Service setting in W7.
Link to comment
Share on other sites

securitybreach

Is this why I couldn't get W8 to talk to a linux based NAS? Also, could not find this Service setting in W7.

 

Dunno but here is a shortcut to get to the Services menu: http://www.sevenforu...rt-disable.html

 

This is the method I was explaining above: http://www.sevenforu...e-services.html

 

I thought it was under "Programs and Features" but it is under Control Panel-Services.

Link to comment
Share on other sites

Take a look at the Openfiler distro. It's similar in functionality to FreeNAS but is CentOS-based. It can be used to create SAMBA/NFS/iSCSI targets via a web browser.

  • Like 1
Link to comment
Share on other sites

securitybreach

Take a look at the Openfiler distro. It's similar in functionality to FreeNAS but is CentOS-based. It can be used to create SAMBA/NFS/iSCSI targets via a web browser.

 

Interesting, thanks :thumbsup:

Link to comment
Share on other sites

Josh came up with a very good point earlier in this post to just run Arch Linux on the server and run SAMBA from there. Makes sense as I am confortable with Arch. The Ubuntu Server is agrivating the heck out of me. So my plan is, I have a box (big older Dell XPS) that holds 3 IDE Hard drives. I have a 10 GB IDE (which will house Arch) a 500 GB IDE that will be the storage hard drive for the file server and another brand new never used 100 GB IDE that I have not figured out what I want to do with but figured I can add it and configure it so if I find a use for it, it will already be there. I was reading the Arch Wiki on SAMBA this morning which only proves to me that I really have a lot to learn but luckly I have the hardware handy with out putting out any $$$ so just like with Arch Linux, if all else fails, try try again. :)

  • Like 1
Link to comment
Share on other sites

Well, I have everything I need. I mentioned earlier about this Dell XDE that holds 3 IDE hard drives, well I only assumed this because it has a 2 1/4 floppy drive and I had never opened it up. I aquired it a while back and put it in a closet. The MOBO and PS are set up for SATA. Not a problem. I installed a dual IDE contoller card via PCI and was waiting for my sata to molex adapter and now I have them. So I now have the 3 hard drives installed, all the proper cables and what not and hopefully tonight I can connect everything, close it up and start'r up. I did infact install 3 IDE hard drives because I had them on hand. I'm frugal and I do not have a money tree so like FrankenstIAN (my arch desktop) I am using what was already available. (The cables were only $6 so I did spend a small amount :hysterical: )

 

Now I have a question for the Arch Gurus. If I use Arch as the base OS for the server which I plan to do, do I still need to worry about updating it every day with pacman -Syu? I'm thinking once the base system is there and I install just those things I need, then what is there once Arch is installed off of the CD should be fine or I recon I should do all of the updates once the base system is installed then I should be good to go?

 

Opinions?

 

Thanks,

Link to comment
Share on other sites

securitybreach
Now I have a question for the Arch Gurus. If I use Arch as the base OS for the server which I plan to do, do I still need to worry about updating it every day with pacman -Syu? I'm thinking once the base system is there and I install just those things I need, then what is there once Arch is installed off of the CD should be fine or I recon I should do all of the updates once the base system is installed then I should be good to go?

 

Opinions?

 

Thanks,

 

Well I would update it everyday like you do a normal Arch installation if you plan on updating it all. The reason being is sometimes the updates depend on other updates and you could bork your system. I have been running Arch on my server (Linode) for the last 3 years and I have not had any breakage and very minimal downtime. Now you could never update the system and everything would work as it normally would as long as you never tried to update it later on. I would suggest setting up ssh on the server so you never have to physically access it and you can update it daily over ssh. There should not be many updates as this is mainly a server therefore it will not have that many packages installed.

  • Like 1
Link to comment
Share on other sites

Thanks for the opinion Josh, it comes highly respected. I had every intention on running SSH from my Arch Laptop to control the server. Have never used it before but reading the Wiki, it does not look all that hard.

Though don't be a bit surprised if I am back on here soon asking lots of questions. ;) LOL

Link to comment
Share on other sites

securitybreach

Thanks for the opinion Josh, it comes highly respected. I had every intention on running SSH from my Arch Laptop to control the server. Have never used it before but reading the Wiki, it does not look all that hard.

Though don't be a bit surprised if I am back on here soon asking lots of questions. ;) LOL

 

Feel free to ask as many questions as you like. :thumbsup:

 

I have three machines I access everyday via ssh so I have a lot of experience in remote computing. B)

 

BTW (Gnu)screen is extremely useful for headless machines or remote servers as you reconnect/disconnect to a session whenever you like.

https://wiki.archlin....php/GNU_Screen

 

Here is an example config from my main rig:

screen -t xxxx 0 ssh -p xxxxx xxxxx@xxx.xxx.x.xxxx

screen -t Baphomet 1 ssh -p xxxxx root@xxx.xxx.x.x

screen -t DarkStar 2 ssh -p xxxxx comhack@xx.xxx.xxx.xxx

screen -t torrent 3 rtorrent

screen -t mpd 4 ncmpcpp

screen -t htop 5 htop

screen -t mc 6 mc

screen -t shell 7

screen -t shell 8

screen -t shell 9

screen -t shell 10

select 0

 

altscreen on

term screen-256color

bindkey -k k7 next # F9

bindkey -k k9 prev # F7

 

hardstatus off

hardstatus alwayslastline

hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'

#hardstatus alwayslastline

#hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'

startup_message off

 

IGtb2.png

Link to comment
Share on other sites

Thanks again for the info, may need to check that out. Considering that there will be Windows computers also on this network, what would you suggest I format the 500GB HDD to FAT32 or NTFS?

Link to comment
Share on other sites

securitybreach

Thanks again for the info, may need to check that out. Considering that there will be Windows computers also on this network, what would you suggest I format the 500GB HDD to FAT32 or NTFS?

 

It does not matter as both can easily be used in Linux. Fat32 requires nothing but you will need to install ntfs-3g for ntfs:

https://wiki.archlinux.org/index.php/NTFS-3G

https://wiki.archlinux.org/index.php/Writing_to_FAT32_as_Normal_User#Writing_to_FAT32_as_Normal_User

 

If you have any files that are over 4gb, then Fat32 would not be a good choice as it has a 4gb file size limit. I would suggest ntfs as it is much faster (at least in my experiences).

Link to comment
Share on other sites

I figured as such and I knew the size limitations of Fat32, but with both Linux and Windows playing on the same network, I wanted to make sure I chose the best option. :thumbup:

Link to comment
Share on other sites

Making some baby step progress. Hooked up all the cables, closed her up and hit start. Initially it did not recognize any of the hard drives. Shutdown, swapped out the IDE ribbon cable with another one and started it back up. Alas, 2 of the 3 hard drives were recognized. For some reason, it is not recognizing the third hard drive, could be how I have the jumper set. But in the grand scheme of things, it is really a moot point as I only put it there just because I had it.

So I have downloaded the current Arch Linux Dual iso and burned to CD. Hopefully this evening or this weekend, I can get Arch up and running. Be the first time installing Arch with the new setup but I have done some reading so don't expect it to be a show stopper. (At least I hope it doesn't) :)

 

More to follow. :)

Link to comment
Share on other sites

They say the road to H3ll is paved with good intentions. My goal was to have this thing up and running this weekend but "life" gets in the way all to often. I did, change out the 10 gb hard drive with a 20 because the 10 pretty much died. No big deal. I did get a base Arch Linux install complete so that is good. The new way of installing is not all that bad but would say it's not that great for a new Arch explorer. I say that because the old installation would have you looking at your conf files where this one does not. YOu kind of already need to know about pacman.conf, rc.conf etc before going into this.

But now that I have the base system installed, it's time to work on getting SSH set up on this lappy so that I can go headless. :)

 

Onward and upward :)

 

Edit: I would make one exception. Make sure you create all of your partitions ahead of time with gparted using parted magic or gparted if you have a bootable one. Makes it easier. I always use Parted Magic anyway to set up my partitions but will save the new Arch explorer a little head ache. Once the partitions are set up, simply use fdsik to set the primary partition as "boot" and then select "write"

Just an opinion :)

Edited by ichase
Link to comment
Share on other sites

Josh,

Quick question. Is there any reason why I would need to install a DE or WM on the server? It is going to be headless so I am guessing there should be no reason or need to have a WM or DE? Nor would I need to install Xorg or video drivers either.

 

Agree? Disagree?

 

Don't worry, I have no doubt I will be having more questions. LOL

Link to comment
Share on other sites

securitybreach

Josh,

Quick question. Is there any reason why I would need to install a DE or WM on the server? It is going to be headless so I am guessing there should be no reason or need to have a WM or DE? Nor would I need to install Xorg or video drivers either.

 

Agree? Disagree?

 

Don't worry, I have no doubt I will be having more questions. LOL

 

You are correct!! If you are going run the server headless; you will not need an xorg, video drivers or a window manager.

Link to comment
Share on other sites

securitybreach

You just need some cli utilities for monitoring the system and accessing it. Here are a few suggestions of ones I use:

 

openssh

(Gnu)screen

htop, atop and ntop

glances

ranger or MidnightCommander (mc) filemanagers

nano, vim and/or emacs text editors

dnsutils

irssi or weechat (for irc)

wget

yaourt

openntpd

rtorrent

Link to comment
Share on other sites

Thanks for the guidance and list of programs. My biggest thing will be to be able to use the 500gb hard drive installed in the server as storage for any and all computers on the network (Windows or Linux) and the ablitity to be able to print from any of those computers as well. OpenSSH will allow me from the laptop to perform updates on the server with out the need to have a keyboard, mouse and monitor on the server box. Looks like now that I have the base system installed (installed both the base and base-devel packages) I will just need to update the /etc/hostname, /etc/rc.conf so that I can create a host name and static IP address. Until I perform these functions, I won't be able to access it via SSH from what I have been reading.

 

Babysteps but a GREAT learning experience. :)

  • Like 1
Link to comment
Share on other sites

Well I have been doing a lot of reading and OpenSSH (though probably simple) is just not clicking with me. Just can't seem to wrap my brain around how to set up the /etc/ssh/ssh_config and sshd_config files on both the laptop and server. Simply put, I want to be able to access the Arch terminal on the server from my laptop. I have not even gotten to point of setting up SAMBA so that I can save files to my storage drive from any computer in the house as well as print.

Starting to think I may have put the cart before the horse in putting together a server before having a full understanding of how to make it accessable on the network and usefull as a file and print server.

 

I may be looking to deep into this and simple connection may be just a few edits in the existing config files. Obviously I need to set these config files on both the laptop where I want to control the server and the server itself.

 

On the server I have succesfully installed Arch Linux on SDA1 (20 GB HDD with 2 GB partition for swap) I have a good Internet connection, have performed all updates, and have installed openssh via pacman. I have set up my /etc/hostname which I simply named HomeServer

I have set up /etc/hosts as such

127.0.0.1   HomeServer localhost
::1					    HomeServer localhost

 

I set up a static IP in my /etc/rc.conf

interface=eth0
address=192.168.X.XX
netmask=255.255.255.0
broadcast=192.168.1.255
gateway=192.168.X.X

 

Now in reading, I can't seem to decipher how to set up the ssh config files on both the server and the laptop in which I want to control the server. At this point, I guess I just need to be pushed in the right direction but at the same time, I am not expecting you all to do this for me. I am just at a point where I am not convinced I am taking this journey starting with step 1 then on to step 2. I probably started at step 5 or something. :)

 

Thanks everyone :)

Edited by ichase
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...