Setting Up a Home File Server Part 1
March 20, 2008 1:20am in tech

Computers are starting to get cheaper nowadays and many people are upgrading, and getting new computers leaving them with older desktops that either are just thrown out or left sitting around collecting dust. One use for these computers is to run as a home server for the family or the individual. Servers don't need to have the latest hardware so that makes the older computers the perfect candidate to be turned into a server. Servers have a whole range of possible functionalities, the most popular for home use being a file server where all can share their files in a central location. All a server really needs is some hard drive space and a network card (along with functional components, but for this, I'll assume that the computer works). I would recommend at least 100GB of hard drive space, the more, the better, but 100GB should do for starters.

The first choice is what operating system will it run. If you're more comfortable with Windows and the desktop will run XP, you can go with that. The other choice is Linux, which as I've stated before has become significantly more easy to use, and in my opinion Ubuntu is the perfect candidate for this. Linux does have a slight learning curve, but its nothing that can't be overcome with some time and effort, so if you're willing to try it, Linux makes a perfect candidate to run as a server. I chose Ubuntu to set as the Linux distribution for this tutorial. Windows 2000 can also be used, but I would strongly recommend Ubuntu over Windows 2000. And if you're worried that if you host a file server under Linux, Windows and OS X won't recognize it, worry no longer, the shares will be accessible for all operating systems.

Ubuntu Linux 7.10

Ubuntu Linux 7.10 Gutsy Gibbon is Ubuntu's latest version of their popular Linux Distribution and it's a pretty good one. The first thing you want to do is go to http://www.ubuntu.com and download the i386 desktop CD. I'd say the server version but I want to gear this tutorial to a basic user so it'd be a help for them to have a graphical desktop to help them out. Once you finish downloading the .iso file, burn the image to a CD using your CD burning software such as Nero or Roxio.

Okay, now you have your CD burned so insert it into your CD drive and boot your computer up from the CD. At the initial menu, choose the option to Install Ubuntu. This will actually start Ubuntu as a live CD which means that you will be able to see basically how your system will look when its all finished. Keep in mind though that any changes you make won't be saved at this time. When you're ready, you should see an icon on the left of your desktop that says "Install". Double click on that to bring up the installer. Follow the prompts and choose the selections until you get to the partitioning menu. Make sure to note what you named the computer in the Hostname field.

I don't have any real way to actually get screen shots for you easily so here's a link that will help with the entire setup, including partitioning. http://psychocats.net/ubuntu/installing

My personal recommendation is that you set aside double the amount of RAM you have (so if you have 512MB of RAM, use 1GB) for your swap partition, give 10-20GB for the root (/) partition and then use the rest for data storage. You have to choose a name for the mount point which must begin with the forward slash (/). I mount my drives as '/data1', '/data2', etc but you can choose whatever names you'd like. The swap partition should be formatted as 'swap' and the others are probably best formatted as 'ext3'. After this just follow the prompts and let the system install.

Ok, I'm now going to assume that the system is all installed, you rebooted and are now looking at your brand new Ubuntu desktop. The first thing you're going to want to do is to get the file share tool up and running. To do this, open up your terminal and type in the following

sudo apt-get install samba smbfs

It's going to prompt you for your password. That command will download and install Samba and the Samba file system. The next thing you will need to do is set up the shares. Now is the time when you have to decide how you want to arrange your files and shares. You can share multiple folders so don't worry about trying to fit all the folders and files into one folder if you want to organize it differently. If you open up your home folder, and then click on Filesystem, you can then navigate to where you mounted your data partition during the install. you can create folders in here for the directories you want to share, just remember what the locations are.

The next part we're going to do the old fashioned way because I've always had more success this way so bear with me. The way I configure my shares is through the configuration file. It may sound difficult, but its actually not terribly difficult so bear with me. The first thing we want to do is to set up a samba user account. This is necessary for other computers to be able to connect as it sets up the credentials.

First navigate to samba's directory. Open up a terminal window and type:

cd /etc/samba

when there type the following command to add a user to the list:

sudo smbpasswd -a username

The first thing its probably going to ask for is your password for the server itself. The next two prompts will be for you to enter the samba user's password and then to re-enter for confirmation. After that is done, the user is all set up and you're ready to go set up the shares themselves.

In the same folder you're in now, you should see an 'smb.conf' file. This is the file you need to edit to add the shares. The first thing you should do is create a backup of it just in case something goes wrong, so run this command:

sudo cp smb.conf smb.conf.backup

This will create a backup file called 'smb.conf.backup' in the same directory should something go awry.

Ok, now lets get into the actual configuration. Type in the command:

sudo gedit smb.conf

This will bring up a text editor to edit the file in. scroll all the way to the bottom of the file. This is where you're going to put the shares. It's important to know that each share will follow the following template:

[share name]
path = /path/to/share (the directory of the share)
comment = enter comment here (not neccessary but helpful)
writeable = yes/no
browseable = yes
guest ok = no

One more comment, on the writeable section, you want to put yes if you want users to be able to write to the share (aka delete, move, copy files to). If all you want is just for a read-only share, then by all means put no instead.

So now lets show an actual example. Lets say I want to share a family pictures folder with other computers in the house. I want people to be able to copy their photos into the share and be able to view the pictures. Let's also say that I created a directory /data1/photos to store the pictures. Here is how I would add the entry into the smb.conf file

[photos]
path = /data1/photos
comment = Family Photos
writeable = yes
browseable = yes
guest ok = no

That's it, not too hard at all, right? You can add all the shares you need to just make sure to put the share name in [ ] brackets to separate them.

After you're done with that save the file and close the text editor. You should be brought back to the terminal window. There's one last thing you need to do in order for it to work. You need to restart the samba server for the changes to take place. To do so, just type the following command:

sudo /etc/init.d/samba restart

It will tell you that the samba service is stopping and then starting back up. Once you get to a prompt, thats it, the shares are all set, so go ahead and give it a try.

In windows, go to Start - Run and type in:

\\servername\share

Where servername is the computer's name or hostname, which you set during the install process. So for my photo share if I named my server "Darker" then I would enter:

\\darker\photos

This should then ask you for a username and password (the one you set up using the smbpasswd command earlier), or if your windows username and password are the same as the samba username and password you set, then it should just bring up an explorer window with your share. In Windows, you have the option of mapping shares to drives so a share would be given an actual drive letter like a hard drive and DVD drive are given. To do this, right click on My Computer and select 'Map Network Drive'. The following dialog box should come up.

 

The first field will let you choose which drive letter to assign it to, it doesn't matter so pick one. (it won't let you choose one that's already in use). The second field is where you type in your share name, which we went over in the last paragraph. The final checkbox determines whether the share should connect every time you log in. Since I'm going to assume that you want to be able to access the share all the time, you can just leave it checked. Just click 'Finish'. If it asks for a username and password, then enter it, otherwise it should pop up an explorer window showing the contents of the share.

So there you have it, you now have your very own file server to host your files on. While this may sound obvious to some, in order for people to be able to access the shares you create, you must keep the server turned on.

Some other uses for your server could also be as a MySQL database server, an Apache/PHP web server, if you're a developer, a subversion repository, as well as countless other possibilities. If any of this peaked your interest, feel free to do some research into them, Linux has a lot of potential that if you choose to put some time into, you can unlock. Also if you're brave enough, you can set up an ssh server on your server so you can access your server's terminal remotely.

Next week, I'll go over how to create a server using Windows XP as the operating system.

If you have any questions, need clarification, have comments, or have an alternate way of doing things, or more insight or help, then please, comment and let me know.


Tags: ubuntu, linux, fileserver, howto

2 Comments

Advantages of Linux and Open Source in General
February 15, 2008 12:03pm in tech

Of late, Linux and open source applications have started to rise in popularity. The most noteworthy have been Ubuntu and of course Mozilla Firefox. Both are superb products that many people, even those not entirely familiar with open source have taken up using. Firefox even more since those glued to Windows can still use it in lieu of Microsoft's Internet Explorer. There are many advantages to using open source software and here are a few examples of individual apps and/or OS' that add to that.

Mozilla Firefox

Mozilla Firefox has started to really cut into Internet Explorer's market share over the past year or two, particularly in Europe. While IE still is the highest used browser, Firefox's market share has been steadily increasing. According to marketshare.hitslink.com, Firefox accounted for 16.98% of the market share, with IE accounting for approximately 75.47% of hits in January 2008. While this does show that Firefox is still WELL behind IE, going back to January 2007, Firefox only accounted for less than 14% of browser market share.

Firefox brings a lot to the table. Despite some memory issues, Firefox has on average a lower memory footprint than IE. Right now, for me, with 6 tabs open, Firefox is using ~35MB of memory compared to ~65MB with one tab open in IE. Firefox also tends to be more secure than IE as well. Yes, Firefox still has its vulnerabilities, but Mozilla tends to be much better and faster at getting fixes out than does Microsoft. Firefox also has what seems like an endless supply of add-ons as well. Themes and extensions allow users to customize their browser as they want including appearance, improved RSS readers, UI additions, performance improvements, even a nice plugin to block those annoying ads that are seen on so many pages.

Ubuntu (and Linux in general)

Ubuntu is a popular distribution of Linux today that offers ease of installation and use that was relatively unheard of say 5-10 years ago for Linux. I have to credit Ubuntu for helping make open source more of a possibility for more people than before. It's installation program as well as what it offers and the general use of it make it relatively easy to use after using Windows for so long. But as I've said before, Linux is not Ubuntu, there are many other distributions out there that are great alternatives to Windows as well (Slackware, SUSE, Gentoo, Debian, Fedora, to name a few).

Despite what Microsoft wants to say, I still believe that Ubuntu works more "out of the box" than Windows. Take my desktop for example. When I installed Windows, almost every component needed drivers to be installed. With Ubuntu, all that needed to be done was to install nVidia's official drivers, but in all reality, the VESA drivers that are enabled by default would work just fine for the general user. While Linux does have some disadvantages with GUIs to configure settings compared to Windows, saying that it doesn't just work out of the box is an outright lie.

Linux in my opinion is more poweful than Windows for an experienced user, and even for someone with basic skills. The terminal, while very basic and not as pretty as say some user interfaces is the heart of a Linux system. You can do so much with the terminal that you wouldn't even need a user interface to begin with. In fact, a lot of Linux servers don't even have a graphical system installed, they're run purely from the terminal.

Linux is also much more customizeable than is Windows. You can make the user interface look however you want. You want to emulate the OS X desktop look, go ahead, Windows XP look? Yup, its got that too. For an experienced user, you can even customize the kernel to best run on your hardware setup, so it goes much deeper than just the user interface.

Another bonus is that of course, Linux is free. That's right, it doesn't cost a penny to download. Compared to the outrageous prices Microsoft is asking for Vista, this has got to be an added bonus. Oh yeah, and all features are available on one version of Linux, not the 10,000 different versions Microsoft has with Windows Vista.

With the exception of gaming, I have not found anything I can do in Windows that I can't do in Linux.

OpenOffice

 

OpenOffice is a full fledged office suite very similar to Microsoft Office. It can read and write in .doc files and in the upcoming OpenOffice 3.0 release, should be able to open and save .docx (Office 2007) files too. Instead of paying who knows how much for Microsoft Office, you can download OpenOffice for free. It has most of the features Office 2003 has and is available on Linux, Windows, and OS X (although with the current version, it runs through X11 and not natively).

Pidgin (GAIM)

Pidgin is an open source alternative to AIM, MSN, Google Talk, Yahoo IM, and many more, all from one client, meaning fewer system resources being needed, as well as fewer programs needing to be open. Pidgin allows you to set up multiple accounts easily under one program, so you can talk to buddies on AIM, Yahoo, MSN, Google Talk, whichever they and you use. The only limitation seems to be that if you need/want to use video or audio, you're pretty much out of luck, as of now anyway. Pidgin is available on Linux and Windows. On OS X, you can use Adium which utilizes the same library that Pidgin uses.

GIMP

GIMP is an open source image manipulation program similar to Adobe Photoshop. While arguably not quite as powerful, GIMP does provide many of the same functionality that Photoshop provides and at oh, I don't know, 100% off the price of Photoshop (aka Free). Despite it not being quite as powerful as Photoshop, it is quite powerful in its own right allowing you to do most of the same work you'd do in photoshop. It is available for Linux, Windows, and OS X.

 

While these only touch on a very small fraction of the advantages Linux and Open Source provide, it goes to show that in all reality, using Linux and open source applications can give you many alternatives, and advantages that Windows and other software just can't provide. Anyone have any other big examples of advantages of using open source and Linux?

Additional Thoughts: Someone on digg pointed out to me that while open-source software might be free, free software can be the proper term to use as it refers to much more than the price, but also the freedom to use, run, modify, and distribute the software as you so choose, and he made a very good point. Proprietary software can't give you that freedom by any stretch of the imagination, and definitely not legally as free software can.


Tags: linux, opensource, thoughts, ubuntu, firefox, gimp, openoffice, pidgin

2 Comments

Microsoft's Competition
January 25, 2008 1:12pm in tech

Everyone knows by now that Microsoft is the leader of the pack when it comes to market share with the Windows Operating System. Over the last few years though, both Apple and Linux are starting to gain ground.

Apple & OS X

With the introduction of Intel-Based Macs, Apple started a new chain of events that has only seen their market share rise. OS X, their operating system I feel is significantly ahead of Windows in terms of usabilty and the whole user interface. I used to bash Macs, mostly because I didn't realize their full potential and what they can actually do. Once I got my iBook G4 a couple years ago, that all changed. The smoothness and the intuitiveness of the operating system and its base programs I thought, and still do think make OS X what it is. So many of the programs are all integrated together, something Windows has a problem with at times. And the base software itself rivals that of Windows. You get so more with OS X than you do with Windows, and if you buy your PC from Dell, HP, etc, you don't get all the crapware that comes preinstalled.

Linux & Open Source

Linux, once the operating system for the true geeks and nerds (no offense to anyone), now is proving to be much more user friendly, and a viable option for those who choose to try it. Ubuntu Linux is probably one of the key reasons for Linux's success recently with its ease to install and use. However though, as many point out, Ubuntu is not "Linux". It is a Linux distribution, but Linux is a lot more than just Ubuntu. I've been using Linux for 2 maybe 3 years now and honestly, if it weren't for games, I probably would have wiped Windows from my desktop entirely by now. It's probably wishful thinking, but I wish that more game developers would consider writing games for Linux. Sure, games like UT2k3 and UT2k4 had a Linux installer, and there's WINE and Cedega, but overall, hardly any mainstream games will run on Linux natively. And running on Linux doesn't mean that the software has to be open-source. You can install closed-source and proprietary software on Linux just as easily if written properly. The idea of proprietary software may be against the "true" open source ideals, but in my opinion Linux and open source are more about the freedom of choice rather than whether or not something is proprietary or open source.

 

It would be wishful thinking that either Apple or Linux could overtake Microsoft anytime soon combined or separately as Windows simply just dominates, but with the sad state of Windows Vista, Microsoft might end up seeing both Macs and Linux gain a little more of the market share.


Tags: windows, linux, apple, microsoft, ubuntu

1 Comments

New Server
January 20, 2008 10:34pm in life

So my new case and power supply arrived on Friday and my server is now set back up. It should hopefully be a lot faster as it now has better hardware. I ended up upgrading the OS as well. Instead of Ubuntu 6.06 Dapper Drake, it now runs Ubuntu 7.10 Gutsy Gibbon. It is a tad bit louder than my old one but runs well so who am I to really complain. Besides, new server maxes out at 7 hard drives instead of 5.

Old Specs:
Intel P4 2.0GHz
768MB DDR PC2100 RAM

New Specs:
AMD Athlon64 2.0GHz
2GB DDR PC3200 RAM


Tags: server, ubuntu, linux

0 Comments

Helping Others Make the Switch to Linux
January 07, 2008 10:07am in tech

I first started using Linux about 2 years ago, and if it weren't for games, Windows would be off my desktop entirely. But anyway, Linux has gone a long way especially with the help of Ubuntu and its ease of install and use. It's package manager (Synaptic) makes installing most software, quick and easy. So why don't more people make the switch? Well to be truthful, Linux is a great operating system, and while I would recommend it to almost anyone, I at the same time realize that it's not for everyone.

Many people say that Linux doesn't work "out of the box". This is the case sometimes, but does Windows work out of the box? This meaning that you install the operating system onto your computer. I know in Windows, it seldomly does so. Think about it, you install Windows...are all the drivers there? Does Windows recognize your network, sound, and video cards? Most of the time for me and Windows it's 50/50, some hardware is recognized, some is not.

Linux can be better, but not always as I found out a week ago when I was trying to install Ubuntu and Fedora on my new desktop.  However, with my old motherboard configuration, Ubuntu installed fine, identified all hardware and installed the proper drivers for it. So looking at my old configuration, one could say that Linux can work out of the box better than Windows, but in reality this is not always the case, especially with laptops as wireless drivers can sometimes cause problems.

Getting people to make the switch over to Linux is not always easy, and I would definitely never try to push the issue with someone who seems to have their heart set on Windows as pushing will probably turn them off to the idea entirely. But if someone seems interested in making the switch, help them out. Show them how to boot from a live CD, offer to install Ubuntu on their machine and set it up for dual boot. I only say Ubuntu because I feel its one of the easier distros to start out with. If you feel that there's a better choice for ease for a Linux newbie, feel free to go that route.

Set them up and give them the basic tour.

Once they're set up, show them how to do the basic tasks like get to a web browser, listen to music, and since I know Ubuntu doesn't support MP3 playback out of the box, it should be a good lesson to show them how to use Synaptic and you can walk them through what you're doing as you install the MP3 codecs. It may seem "DUH" to you, but as a newbie, it probably would be helpful, you can even let them drive (a.k.a. operate the computer with you behind their back). You can even show them these two websites http://www.linuxrsp.ru/win-lin-soft/table-eng.html or http://www.linuxalt.com/ both providing lists of open source programs which are basically the equivalent (give or take) of the normal Windows apps. These lists might help them if they want to do something and are unsure how or what program to use. You can even show them how to search for the app in Synaptic if it's not already installed. This help will help them be able to hopefully work more independently later.

Show them support sites for other places they can go for help.

Most distributions have their own forums where people can go to for support. Show them these sites and bookmark them so they can come back to them for reference should they need to. If you went with the Ubuntu route, http://www.ubuntuforums.org is a good site for support forums. http://www.linuxquestions.org is a good place too which supports multiple distributions. Also be sure to let them know that Google is their friend.

Be ready to help them out and let them know they can ask you questions if needed.

If they've never used Linux before, they're probably going to have a lot of questions that they may not realize right away. Be prepared to answer them, and even provide support when needed. If you really want to get tricky, with their permission, set up an SSH server on their desktop so if you really need to, you can secure shell into their machine and help them out remotely, VNC could also be used to this end and may even be helpful as your friend should be able to see what you are doing from their screen to follow along.

Let them know to try things on their own.

Let them know that if they have a problem, that they should see if they can figure it out on their own first, but that you are still available to help them if they get stuck somewhere. Hands on experience can be a lot better than simply watching how to solve certain problems. But make sure they realize its not you shirking away from helping them rather trying to give them some more experience to grow on. Realizing that they solved something all on their own without any help from you will probably give them some confidence for future problems.

Wrap-up.

Like I said earlier, as much as us Linux and open-source fans love it, Linux is not for everyone. But if someone is interested, show them what it can do. But also be honest, don't tell them Linux can do something if in reality, it can't. We all like to think that Linux can do it all, and for the most part it can do a lot that Windows can and more in some places. But in other situations, Linux just can't truly match it, most notably with games, Wine can only do so much. Microsoft and Windows are going to keep the lead in market share, but that doesn't mean anyone should shy away from or give up on Linux.

I wrote this with respect to Ubuntu but many realize and have pointed out that Linux does not equal Ubuntu, rather Ubuntu is just a flavor of Linux. As stated earlier, from my experience, Ubuntu seems to be a good choice for starting out. If you feel another distribution would be better for them, feel free to use that one instead, and let me know, I'd love to have some other distros to try and see what they bring to the table.


Tags: linux, thoughts, ubuntu, opensource, freesoftware

0 Comments