Linux Server Diary

The trials and tribulations of a Linux newbie trying to setup a home server.

Tuesday, February 27, 2007

Made the Switch!

The other night, I switched over the drive mappings and copied all of the files from the old server to the new. My users (read: family) didn't notice.

Time for the next project: Backup!

Labels:

Saturday, February 24, 2007

Battery Installed

I was able to get out to Interstate Battery ("Every battery for every need") the other day to get a replacement cell for the motherboard, and I installed it this morning. That's the last thing on my checklist before moving this box into production.



I'm glad to be done messing inside the case. Not because I don't enjoy it, but because I'm worried about breaking something. I'm not the most skilled mechanic or electrician in town, and I tend to have trouble with these kind of things. (I mentioned the CD troubles last month; did I also write about cracking a motherboard once?) It is inevitable that I would lose a screw, strip some threads, short a connection, pull something loose, kill a component with static discharge, etc. I should be done until I decide to add a DVD burner.

Labels:

Wednesday, February 14, 2007

Software Installed and Configured

It took a little less than an hour to do the whole process. I'm getting good at this.

Most importantly, files are copying. Yeah!!

I'm going to mess with the server for a couple of days, and probably put it into service Saturday or Sunday.

Labels:

Such a Rookie Mistake!!

I've been fighting this server problem since December, and now, over 3 months later, I've found the problem. I was hoping that the solution would be failing hardware, or maybe a kernel incompatibility, but instead, it is my stupidity.

You may remember from yesterday that Fedora didn't like the IP address I was using. At the time, I just decided to use another and figure out that problem later. During today's experiment with Lormalinux, I didn't receive notice of a conflict and went back to my original choice. And, when I got things setup and began to copy files, the same error that has plagued me from the start cropped up again. After trying a new CAT5 cable with no change, I was looking for an old hub to setup an isolated network, in case it was one of my routers or another workstation causing the problem, but I couldn't find it.

Sitting in my easy chair this afternoon, I remembered the Fedora error, and it hit me. The address I've been using all this time is already in use - on the wireless access point. I changed the address on the Lormalinux server to an unused number, and it's working great. I'm such an idiot!!

Now that I know the problem, I'm going back to Ubuntu 6.10. Lormalinux is working OK, but I put in too much research on Ubuntu to not use that knowledge (plus there are so many more resources available). Since the Purdue/Indiana game was postponed tonight, I should be able to get the whole thing done before bedtime.

Labels:

Lormalinux

Lormalinux is touted as a distro tailored for the education field. What brought it to my attention was my Google search "linux distro preconfigured for samba". It was the first link returned.

Based on Slackware, they offer several configurations, including Samba server, Web/MySQL server, and LTSP server (no idea what that means). I downloaded the Samba version (beta 2) and gave it a try.

Right away, I was surprised by the harshness of the Slackware install. I've been spoiled by Mandrake (now Mandriva), Ubuntu, RedHat and Fedora and their handholding installs. I kind of laughed when, after reading on the web site that this distro is easy for newbies, the installation dropped to a login prompt telling me to partition the drives myself, and then start setup. Now, I've partitioned drives before, but I still had to spend a little time in the help files to figure out what they wanted (every distro seems to be different). I can't imagine a well-intentioned high school English teacher trying to setup a server for his classes being able to do this without help.

Anyway, I then was able to finish the install. In my role as the English teaching newbie, I took almost all defaults and installed the full distro as recommended. (Since I am a method actor, my grammar was impeccable throughout.)

A quick reboot, and I was presented with a character-based login (as I had hoped). I fired up the computer search in Windows and found the machine by hostname without incident, and was able to connect to the default share. After I modified smb.conf to update the workgroup, I could see it in the workgroup computers list.

Next, I fired up the WebAdmin interface included with the distro. It is found on port 10000. It has come up, and my next trick is to configure Samba for my use.

Wish me luck.

Labels:

Tuesday, February 13, 2007

Snow Day! (or My Adventure with Fedora)

The Blizzard of 2007 has started, so the family and I are all home today. Since I've been having zero luck with Ubuntu, I'm trying Fedora 6. Not a bad project to relieve cabin fever.

After seeing that this would be a 5 CD download and burn, I decided to try the network install instead. The first step was to find the elusive boot.iso - a less than 8MB CD image that will boot the system and pull the files from a mirror. This is located in the /os/images sub folder. I burned this and booted. I used the command linux text askmethod to force a text based install and to get the chance to enter the mirror info. It took a few tries to get the mirror definition correct (the path name must go all the way out to the /os/ folder). I answered a bunch of questions, including what software to install. I chose Windows File Server, editors, and a few others. No graphical or window manager stuff. It only took about half an hour.

After rebooting, it came up with a system agent. I unchecked sendmail from the startup list, added smb, but left the rest as is (I think I'll have to do a bunch of research to fine tune the box, but this will work for now).

I added myself as a user, and then looked around for instructions to setup a static IP. I found that the information is stored in /etc/sysconfg/network-scripts/ifcfg-eth0. I commented the line BOOTPROTO=dhcp and added:
BOOTPROTO= static
BROADCAST=192.168.254.254
(is this the gateway?)
IPADDR=192.168.254.1
NETMASK=255.255.255.0
NETWORK=192.168.254.0
(not sure what this is)

These commands stop and start the interface:
/sbin/ifdown eth0
/sbin/ifup eth0


I received an error saying that the IP address was already in use by another host, but I wasn't able to PING it from another machine. I changed it to .2 for now; I'll work on that later.

SSHD is already installed an running, so I was able to log in via PuTTY. The SSHD configuration file is /etc/ssh/sshd_config, and I modified it as outlined earlier.

The Samba configuration file smb.conf is located in /etc/samba/. I pasted in the same config file listed here, except I changed 'Ubuntu' to 'Fedora'. Continuing with the instructions on that page, I created the /export directory, and restarted Samba (using the first restart command listed).

And then, it gets difficult. When I browse the network from my Windows client, I can see the server and attempt to open it. After a long pause, I'm told that I don't have access to it, and the icon disappears from the workgroup devices list. Nothing short of a reboot of the server will bring it back (at least, nothing I know about). Restarting Samba doesn't help.

Well, the day is over, and I'm tired, so I'm putting this little experiment to bed (after about 12 hours of playing around). The most frustrating part has been relearning 'Linux'. I know that most of Linux is actually other software that runs on the kernel, but it can be tough when different distros store files in different places and configure things different ways.

Labels:

Monday, February 12, 2007

Mounting a Samba Share in Linux

Just for my own documentation, here's how I configured the Samaba share from the old server on the new server, courtesy of Tero Karvinen:

Edit $HOME/sambapass
nano /home/myusername/sambapass
username = windowsuser
password = windowspassword
domain = workgroupname
Create an empty directory (a mount point)
$ mkdir /mnt/files2
As root, edit /etc/fstab, add this line in the end (all on one line)
//windowsserver/share /home/tee/mymountpoint
smbfs credentials=/home/tee/sambapass,uid=myusername,gid=users,dmask=700,fmask=700 0 0
Mount everything
# mount -a

Labels:

Sunday, February 11, 2007

Building the New Server - Part 5 - Early Version

Today, I'm trying the 6.06 version of Ubuntu Server to see if the symptoms continue (see many earlier posts for details).

11:30 am
Let's start
11:58 am
Right off the bat, I see that I'll have to switch the kernel as mentioned in Part 2.
12:12 pm
Time to go through additional software installation and configuration - as outlined in Part 3.
12:33
OK, I didn't even get through those steps before SSH disconnected. I'm running out of options!

I may have to try another distro. Time for a break!

UPDATE:

OK, I decided to come back and finish the configuration, both to build a complete test bed and just for practice. I just want to say that my first server ran on Win95, and it worked great right out of the box!

Sorry, I'm venting a little - I didn't really mean that I would go back to that. Let's just continue.

12:58 pm
I'll finish the Samba and ntpdate steps.
Note that the cupsys-common package is apparently not used in this version
Also note that my syslog is filling up with messages looking for a file called /etc/printcap which doesn't exist. I created an empty file with touch /etc/printcap which stopped the entries.
1:17 pm
Done

Labels:

Building the New Server - Part 4 - The Problems

I've kept the tone of Parts 1 , 2, and 3 on the positive side and saved all of the frustrating issues for this post - mainly because they are not central to the building a server discussion. I'm documenting them here just to have a record of the symptoms and solutions (if any).

Problem 1: The Battery


Every time I unplug the power supply (which has been often), all of the BIOS settings go back to factory. It's not a big deal, except for clock reset back to January 2006, and the fact that the default expects a floppy drive. Fixing the time/date isn't a huge deal because of the ntpdate software, but without a floppy attached, I have to press F1 to continue. This will be a problem once I go 'headless', since there won't be a keyboard to use, and there won't be a monitor to even see the error. I guess I'll take the battery out and go to Interstate Battery for a replacement. I haven't yet looked to see how easy that will be.

Problem 2: The CD-ROM


I've been feeling bad about using the term 'ghetto' to describe the temporary CD-ROM setup, and the Political Correctness gods have decided to punish me by making it not work. I tried different cables and different CDs, but always came up with crc errors. But, I'm not ready to order a new drive that will fit in the case. This morning, I was venting to my son about it. He excused himself and returned with three old drives that he had been hoarding in his room. After hooking up the first one, I powered up the box and pressed the eject button. It was then when I remembered why I retired this drive; the drawer doesn't open without a little assistance from a paper clip. I dug one up (my wife seems to bring home dozens a week in her scrub top pockets) and gave it a little encouragement. Sitting in the tray was the Office XP Professional disk I've been missing for a year and a half! Anyway, I'm now back in business. I guess the first drive from last week didn't like being manhandled and gave up the ghost. One problem solved!

Problem 3: Still Doesn't Work!


This is the biggest of all. After spending the money on hardware, spending time on construction and installation, I still have the same problem I couldn't solve before - the network keeps disconnecting Samba and SSH (the only things I'm running on the box). I've tried a lot of things, and all I've proven is that it is an intermittent problem. I've used a Windows PC to connect to Samba, and tried mounting the old server's samba share directly on the new server. In both cases, a long copy job will eventually fail. From more than one machine, I've had SSH sessions drop. I've used different ports on different routers/hubs, and built an entirely new server. The only variable left is the software. My plan next is to try Ubuntu 6.06 LTS Server version. (Stay tuned.)

For those that love details, I captured log entries from my last copy attempt. This was the server-to-server path:
smbd[4198]: [2007/02/10 16:21:01, 0] lib/util_sock.c:write_data(557)
smbd[4198]: write_data: write failure in writing to client 192.168.254.160. Error Connection reset by peer
smbd[4198]: [2007/02/10 16:21:01, 0] lib/util_sock.c:send_smb(765)
smbd[4198]: Error writing 4 bytes to client. -1. (Connection reset by peer)

smbd[4199]: [2007/02/10 16:33:08, 0] lib/util_sock.c:read_data(529)
smbd[4199]: read_data: read failure for 4 bytes to client 192.168.254.160. Error = Connection reset by peer
smbd[4199]: [2007/02/10 16:33:08, 0] lib/util_sock.c:write_data(557)
smbd[4199]: write_data: write failure in writing to client 192.168.254.160. Error Broken pipe
smbd[4199]: [2007/02/10 16:33:08, 0] lib/util_sock.c:send_smb(765)
smbd[4199]: Error writing 75 bytes to client. -1. (Broken pipe)

This was about 3GB into a 15GB directory copy. It's important to note that I can copy the entire 60+GB contents of the file server to my backup partition on my desktop without incident, so I don't think the old server is the problem.

Labels:

Friday, February 09, 2007

Building the New Server - Part 3 - Configuring Everything

I reinstalled and configured software as outlined here, although I had to reverse the SSH and repository steps commenting out the CD as a source since I have no CD-ROM (more on that later). Also, I ran through the additional configuration steps here, here, and here.

While I was messing around, I installed ntpdate to automatically set the clock every hour.
Install the software
sudo apt-get install ntpdate
Run the script to set the clock
sudo /etc/network/if-up.d/ntpdate
Edit /etc/default/ntpdate to use your favorite time servers.
Mine are tick.cerias.purdue.edu and tock.cerias.purdue.edu.
Add the job to the CRON list.
crontab -e
Insert this text and save and close the file
@hourly /etc/network/if-up.d/ntpdate

Labels:

Thursday, February 08, 2007

Building the New Server - Part 2 - Installing the Operating System

A couple of weeks ago, I prepared a USB flash drive as bootable with the Ubuntu 6.10 Server install files ready to go. I tried it out on my Dell at work, and it booted. However, I wasn't able to get my son's computer (which has a USB boot option in the BIOS) to work with it, and this new computer had the same problem (and I think a very similar BIOS).

So, I had to go a little ghetto (is this an offensive use of the word?) and wire up an internal CD-ROM drive as an external.

Dog not included

Looks a little cheesy, but it worked.

The install went great. I used pretty much all defaults except for the hostname. Since the BIOS recognized the full disk drive size, I didn't have to do any special partitioning to see all of it.

The install finished, and I booted up the system for the first time. Well, at least I tried to. Soon after GRUB started, the box would reboot. How frustrating! I tried booting the CD-ROM again, and it came up no problem.

As usual, a quick Google search found both the problem and the solution. A guy named Joel posted this quick note that talks about the VIA processor not being fully 686 compatible, and how the Ubuntu server version uses a special kernel that calls the very instruction that the VIA can't handle. His easy instructions walked me through how to boot from the CD in rescue mode and switch the kernel with these two commands:

apt-get install linux-386
apt-get remove linux-server

Now, it boots, and I'm ready to start the configuration, again.

Labels:

Tuesday, February 06, 2007

Building the New Server - Part 1 - Hardware Assembly

Despite the snow storm, the parts for the new server were delivered today. With all extracurricular activities canceled for the evening, I began putting things together after supper.


Now, how hard can it be to put four pieces together? In my defense, I had to spend some time just looking at it. I have to imagine the work before I can do it. Next, I read the limited documentation provided with the motherboard, and scanned the single sheet diagram that came with the case (which told me absolutely nothing).


First, I installed the motherboard. It didn't take too long to attach the screws and connect all of the wires. The mobo doesn't have FireWire support, but everything else found a place. During this step I popped in the memory.


Next, it was time to install the hard drive. It only took me half an hour to realize it should be mounted upside down! Who knew? The minimalist diagram didn't show any parts not included with the case. For some reason, I had laid the drive bottom up on the table and happened to look at it. Look, these holes line up. Hmmmm.


Finally, I buttoned up the case. It was a tight fit to get all of the cables tucked in and out of the way while still reaching where they needed to be. I plugged it in, and the lights came on and the hard drive spun up. I was ready for software.

Labels:

Saturday, February 03, 2007

Pay Day Fun


Well, as I threatened a copule of weeks ago, I ordered the new server parts the other day. As we speak (I know, we're not actually speaking), I'm watching the packages travel across the country via the tracking pages provided by UPS.
How long until we will be able to see live GPS feeds of our packages as they speed down the interstate, or fly to and from Memphis? "Look Honey, I think the truck is about to turn onto our street! Get my camera!" Wouldn't that be both amazingly cool and frighteningly anal at the same time? Homeland Security would never go for it.

As I passed a FedEx truck driving back from Indy today, I wondered if my memory chip was in that tandem trailer (although I doubt if UPS would use a FedEx truck).

Anyway, the case looks to be about the size of a Mac Mini. Just enough room for the motherboard with the VIA processor, my exising 3½ inch hard drive, and an optical drive in the "slim-optical" footprint. The optical drive will come later, but I plan to get a DVD burner to use for backups. 512MB of RAM is more than enough for a file server used by the four of us to store bootleg music and digital snapshots.

The parts should arrive by Tuesday, and I'll likely assemble the whole thing in about 20 minutes. Next, I'll reintall Linux and setup the software for the third time. I'm getting lots of good practice!

Labels: