Brool brool (n.) : a low roar; a deep murmur or humming

64-bit Gentoo on the SN95G5

 |  coding

I am making this in the hopes that I can save someone else some time, and also in case I ever need to do this again. I’m loving the Gentoo setup, now that I’ve got it — it’s very fast and lean — but it was a pain to set up, and took me three or four tries. Installing Gentoo was this weird inversion from Windows. Installing Emacs, rebuilding the kernel, setting up software RAID? 2 minutes! Getting the mouse wheel to work? Hours and hours of frustration.

The Shuttle SN95G5 is not a bad system, although from what I’ve read there are many problems with them. I really should have gone with something less bleeding edge. Make sure that you get a V2.0 board; the earlier ones had more problems, although it’s no guarantee: the first SN95G5 I got (from Newegg) was a V2.0 board but wouldn’t even boot.

Nonetheless, it has to be mentioned that the chip, at least, is fast: in my unofficial benchmarks of my (computationally heavy) stuff, the Athlon 3500+ in 64-bit mode is almost twice as fast as the P4 2.4G that I had previously, which is a pretty nice increase.

First thing you need to do is check and see the Gentoo installation article at this site is available: it helped immensely in setting up the system.

Some notes about the installation:

In order to get the Shuttle’s SATA and network to work correctly, I had to do the following:

boot: gentoo noapic

modprobe sata_nv
modprobe sk98lin
net-setup eth0

When you build the kernel, you can’t use genkernel — you have to build it manually. You’ll want to include the following driver in the kernel to support the on-board SATA:

Device Drivers -->
  SCSI device support -->
    SCSI low-level drivers -->
      [*] Serial ATA (SATA) support
        < *> NVIDIA SATA support

… as well as the following for the on-board network:

Device Drivers -->
  Networking support -->
    Ethernet (1000 Mbit) -->
      < *> Marvell Yukon Chipset / SysKonnect SK-98xx Support

Finally, if you’re going to want to link to Windows drives, you should add Samba support:

File Systems -->
  Network File Systems -->
    < *> SMB file system support

At that point, everything goes as planned until you get to the point where it asks you to create your domain name. I was not able to get that to work; from googling around, it looks like the way to get your domain name in there correctly is to get rid of /etc/dnsdomainname and instead put the following in your /etc/hosts file: domain.system system localhost

Finally, when editing the grub configuration, make sure that you have the noapic line at the end:

kernel /kernel-2.6.5-gentoo root=/dev/sda3 noapic

More Installation Notes

Samba: just “emerge samba” and make it come up at boot:

emerge samba
rc-update add samba default

To mount another drive, use the mount command, as in:

# create the mount directory -- only need to do this once
mkdir /mountdirectory
mount -t smbfs -o username=user //windows-name/folder /mountdirectory

X: turned out to be a timesuck. After doing the emerge xorg-x11, run the xorgconfig command instead of the X -config command, as recommended in the manual. The -X config autodetection did not work for my Radeon 9200 card.

Getting the mouse wheel to work was painful. You’ll need the following in your /etc/X11/xorg.conf file:

Section "InputDevice"

# stuff here

    Option "ZAxisMapping" "4 5"
    Option "Buttons" "5"
    Option "Emulate3Buttons" "no"

# more stuff here

Note that I specifically had to turn Emulate3Buttons off, as it was getting set on by default — check your /var/log/Xorg.0.conf log to see if this is happening.

When all that is said and done, my mouse wheel still isn’t working. It turns out that using my KVM switch, at all, will break the mouse wheel (and only the mouse wheel) until the next time I reboot, even though it works fine under Windows. I’ve decided that I have to live with this. Googling claims that this is a function of the el-cheapo Belkin KVM switch that I have.

Enlightenment: I love this window manager. After “emerge enlightenment”, you’ll get to an ugly background with unreadable menus. That’s no good. Edit ~/.enlightenment/user_theme.cfg and change the theme to BlueSteel. (The original theme is looking for fonts that don’t exist). Run, don’t walk, to and get some better themes. Themes are installed by putting them into their own directory in ~/.enlightenment/themes, and then using the third mouse button and picking the theme from the Enlightenment menu.

Software RAID: The documents at Alioth are the way to go. Basically, I wanted to add the RAID 1 onto my just-installed Gentoo system.

I had a couple of simplifying assumptions: I didn’t care if the boot disk was under RAID, I just wanted the root drive mirrored. My partition set up was as follows:

/dev/sda1 -- 100M -- boot
/dev/sda2 -- 1G -- swap
/dev/sda3 -- big! -- root and everything

I just wanted the exact same thing on the other drive, and I wanted my old drive (/dev/sda3) and my new drive (/dev/sdb3) to be mirrored with each other. I (naively!) thought that I could just create the mirror and go, but it wasn’t quite that easy: the RAID partitions need to be a particular format. So instead, following the instructions in the aforementioned document and modifying them slightly, I did the following…

Whoops! Disclaimer first: I didn’t know what I was doing, I’ve probably made tons of mistakes in the following, and you’re liable to destroy your drive. There, I’ve said it.

Step 1. Added RAID to Kernel

Device Drivers -->
  Multi-device support (RAID and LVM) -->
    < *> RAID support
      < *> RAID-1 (mirroring) mode

Rebuild, reboot, check that you have a /proc/mdstat file.

Step 2. Install mdadm

emerge mdadm

Step 3. Partition second disk just like the first.

sfdisk -d /dev/sda | sfdisk /dev/sdb

Step 4. Change partition type on new disk.

cfdisk /dev/sdb

Change the type of the partition to hex ‘fd’

Step 5. Create and format RAID device

mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb3
mke2fs -j /dev/sdb3

Step 6. Create a mount point and copy the system

mkdir /mnt/md0
mount /dev/md0 /mnt/md0
cp -axu / /mnt/md0

At this point, your RAID drive at /mnt/md0 should contain an exact copy of your main drive.

Step 7. Update the fstab on the RAID

Change the “/dev/sda3” line in your /mnt/md0/etc/fstab to reference /dev/md0.

Step 8. Test the RAID drive

Reboot into grub, but don’t let it boot automatically; intead, edit the boot command so it reads:

kernel /kernel-2.6.5-gentoo root=/dev/md0 noapic

Reboot, run “mount” to make sure the raid is mounted. Works? Make the changes to /boot/grub/grub.conf permanent, and then reboot.

Step 9. Add the old drive back in

Change the partition drive of the old partition to ‘FD’ with cfdisk or fdisk, and then add it into our RAID device with:

mdadm --add /dev/md0 /dev/sda3

At this point, it is automagically added and mirroring your new drive back onto your old drive. You can watch the status by doing “cat /proc/mdstat”. It took me about an hour to mirror a 250G partition.


Comments are moderated whenever I remember that I have a blog.

Tom B | 0000-00-00 00:00:00
Thanks for that<br/> Just wanted to say thanks - I think ! -getting new SN95G5 tommorrow and your notes should come in very handy. Cheers!
vitko | 0000-00-00 00:00:00
Very nice tutorial<br/> Thank you for sharing your experience. I'm deciding between SN95G5V2 and V3. So far I'm seen many working V2 Linux setup, but none V3, sigh. (If some lucky owner of V3 is reading this tutorial, please some a note.)
Add a comment