Otter

From Wildsong
Jump to navigationJump to search

Otter is a Toshiba Magnia SG20.

Here is a tar file containing a version of the lcd program hacked for the Magnia SG20. The file contains both an executable and the source files. File:Lcd-sg20.tar.gz

Goal

Set up as a general purpose home server, replacing as many small dedicated boxes as possible. These boxes include a gateway router, a VOIP telephone adapter, an ethernet switch, and a WiFi access point.

Along the way I am preparing an Ubuntu disk image that other people can try on their SG-20's.

I feel the computers I use should use no more energy than required to get the job done, and they should be as quiet as possible. You should have to check the LED on the front panel to see if it's on.

Using Otter as my SOHO server is part of my Carbon diet.

What I like about the SG20

  1. It came with Linux on it. It can be upgraded and hacked in many ways.
  2. Low power consumption.
  3. It's small.
  4. Has a generic Intel CPU that is fast enough for a SOHO server.*
  5. Uses generic PC components for drives and memory.
  6. Has extra goodies hidden away inside like the video slot.
  7. The serial LCD display.
  • Compare with a Via C3 which is not quite a 686 so it crashes if you try to run 686 code on it.

What I don't like

  1. Noisy drives
  2. Noisy fans
  3. No externally accessible serial port.
  4. No USB ports.

I know I could hack the daughter board to add a serial port so that I could use it as a serial console but am not willing to invest the time in populating the board to install one. Lack of USB ports is remedied on the newer SG-30.

History

03-2007-- I've had it for several years now. I used it with the stock Redhat 7.2 for about a year, then shut it down for a while. When I started writing this page, I did most of the upgrades described here.

Hardware

Disks

It had two 30 GB drives when I got it. I replaced the second hard drive with an 80 GB leftover from a laptop upgrade.

The 30 GB drive is a Toshiba MK3017. The 80 GB drive is a MHV2080AT.

These are both 4200 rpm drives; I'd like to replace one or both with 7200 rpm drives but probably won't for a while.

Memory

I pulled a 512MB PC133 DIMM out of a computer that I got dumpster diving, it works fine. It's not ECC, so I had to hookup an AGP video card and keyboard and turn off ECC in BIOS. While I was in there I set it to boot from the network. I can PXEboot from a Linux desktop system into a rescue mode.

Fans

The stock power supply fan was too noisy, so I hacked out the case a bit for more air flow. Then I put a 80 mm fan on top of the power supply and run it at a low speed.

Software

Boot from network (PXEboot)

You can bypass the hard drive and boot your Magnia from another server on your network. It's not easy, as you have to get BIOS access to switch it on, but once it's set it's set forever.

If you try "PXEboot", you need to set the network adapter in the Magnia to use LAN for booting and you need to use the WAN network port. It's an Intel Etherpro 100. The SG20 will not boot off any of the other network ports; not the etherswitch LAN ports nor the wireless card if you have one.

I used the "Trinity Rescue Kit", build 279 and was able to ssh into the Magnia. I hacked the TRK startup scripts to allow this; by default it will require entering a new root password from the Magnia console (which is not hooked up, that's the whole point of the netboot.)

Having network booting means that I have another option when the system won't boot from its internal drives. I can netboot, then use ssh to log into the machine and see what happened when it booted, see if it properly detected the hard drives and peripherals and so on.

For example, right now my Magnia is not bootable from the hard drive but I can see this by typing 'dmesg' after booting with TRK.

Probing IDE interface ide0...
hda: TOSHIBA MK3017GAP, ATA DISK drive
hdb: FUJITSU MHV2080AT, ATA DISK drive

This means that it's seeing both drives; I had to change the jumpers on the 80 GB drive from Master to CSEL (cable select) mode by adding a jumper before the Magnia could see it. I just added this drive from a laptop that I upgraded.

Using the TRK, I can mount /dev/hda1 (where I installed Ubuntu) and edit critical system files. The problem turned out to be in the configuration of the network interfaces. I installed Ubuntu onto the 30 GB drive using a VMWare virtual machine and it set up the ethernet interface wrong.

It was finding the network card as '/dev/eth2' instead of '/dev/eth0' so it was not working.

Ubuntu

I have installed Ubuntu 7.04 Feisty Fawn (upgraded from 6.10 actually).

The big deal with operating system upgrades on the Magnia's is the fan control for the CPU and System fans. Without the proper control software, the fans stay on all the time.

I tried installing Debian on it a couple times but then decided I did not want to go with either the Stable (= OLD) or Unstable editions for this server. Ubuntu is closer to the head of the tree for software releases, and the desktop edition is running on two other machines that I use here at home. So Ubuntu it is.

Stuff you need to know

  1. Default IP address on the LAN is 192.168.123.101
  2. Set for DHCP on the WAN port.
  3. Login via ssh, not telnet.
  4. Usernames and passwords: superuser: root / admin regular user: sshuser / user
  5. Firewall is set to accept no connections from outside (WAN).

Set up for image

hda1 3.0 GB /     ext3   The root filesystem
hda2 3.0 GB       ext3   Alternate root partition for later upgrades
hda3 ext
hda5 500 MB       SWAP
hda6              The rest

I am not mounting the other filesystems right now, to make it easier for you to customize or install onto drives of other sizes.

My installation includes the options for DNS and LAMP services. DHCP is turned on. So is ssh.

I suggest you bring the system up disconnected from the Internet, and change these passwords before connecting it. Connect via ssh and use the command

sudo passwd sshuser
sudo passwd root

If you need an ssh client for Windows, I recommend 'putty'.

Other packages that I added

I enabled the 'universe' packages by uncommenting the appropriate line in /etc/apt/sources.list then I added some other things

I recommend the use of the XFS filesystem over EXT3 for large (> 1 GB) partitions. I keep the root filesystem on EXT3 because it makes things easier when using recovery tools. (Grub works better on EXT3, too.)

I also added the packages necessary to compile the lcd/fan control program.

Add ons

LCD and Fans

The 'lcd' program is available in source code form from the SG-20 group area on groups.yahoo.com. I compiled and installed it, now I get proper readings on the lcd display. THANKS Hans-Michael and Eric! It uses lm-sensors and smartmonctl.

I hacked it a bit to make it work on my SG-20. I also added a Fahrenheit mode. See /etc/default/lcd Source code is in /usr/src/lcd-2.1/

The lm-sensors package adds the ability to read the system sensors. The standard Ubuntu 2.6 kernel + lm-sensors will give you output like this:

# sensors
via686a-isa-6000
Adapter: ISA adapter
CPU core:  +1.76 V  (min =  +0.06 V, max =  +3.10 V)   
+2.5V:     +2.48 V  (min =  +2.36 V, max =  +2.61 V)   
I/O:       +3.36 V  (min =  +3.12 V, max =  +3.45 V)   
+5V:       +5.03 V  (min =  +4.73 V, max =  +5.20 V)   
+12V:     +11.59 V  (min = +11.35 V, max = +12.48 V)   
CPU Fan:  5720 RPM  (min =    0 RPM, div = 2)          
P/S Fan:  5578 RPM  (min =    0 RPM, div = 2)          
SYS Temp:  +15.6°C  (high =  +146°C, hyst =  +133°C)   
CPU Temp:  +16.2°C  (high =  +146°C, hyst =  +133°C)   
SBr Temp:  +24.8°C  (high =  +141°C, hyst =   +54°C)

The smartmontools package talks to the hard disk drives, and can get the drive temperature if the drive has a sensor. I have two drives, the Toshiba drive does not have any sensor but the newer Fujitsu drive does.

Fan control

I put a copy of the fan control program in /usr/bin/fanctl, so that I can type

fanctl --cpu=off --system=off

to turn off the noisy fans when I want to.

Web server

Apache is running but nothing special is installed.

Database server: mysql username and password: root/admin (set with "mysqladmin password admin")

Firewall

I briefly looked at "Shorewall" and decided it was too complex. "Firestarter" requires an X client. The one that seems most appropriate for this project is "lokkit". So I installed that. Lokkit is a simple tool you run to set up iptables rules.

Printing services

I installed cupsys to allow the system to work as a print server. This was one of my primary goals for this system, to allow printing from any of my computers on my little Canon inkjet printer.

This also requires USB support. If you have an SG-30, fine. I happen to have an SG-20 which does not have built in USB ports so I got a PCMCIA card. I plugged in a pair of USB headphones to try the USB card out and the Magnia froze up, so I might end up not using the USB printer after all. Oh well. :-(

I modified /etc/cups/cupsys.conf so that its built-in web server listens on all ethernet addresses, not just localhost. Connect with a browser to port 631, http://mymagnia:631/ for example. You should consider editing /etc/cups/cupsys.conf file to allow connections only from your local network.

Support for Windows clients with Samba

I installed Samba so that you can share file and print services with Windows clients. I installed 'swat' so that you can change the Samba configuration using a web browser. I installed 'inetd' since swat runs as an inetd service. Connect to it with a web browser. It runs on port 901. So for example, http://mymagnia:901/

Personally I don't use swat but I thought you might want to.

DHCP

I installed and configured the dhcpd server package. It assigns numbers in the range 192.168.123.101-199. This is set in the file /etc/dhcpd.conf