Squeezebox Setup

A few tweaks

Before installing too much stuff, and even with everything checked off in the install there is still a bit of tweaking to be done.

  1. Download the helper programs you need in windows – WinSCP and Putty will be invaluable. WinSCP lets you transfer files, putty lets you log in. I am using Putty to ssh in, and logging in as root to make these changes, but if you aren’t comfortable with the command line and vi you may wish to use WinSCP to edit files. You may also wish to create a new user and use sudo rather than logging in as root. Personally while sudo is good once a box is running, for the actual setup of the box it’s a bit over the top.
  2. Turn off the firewall. In my case the server will be sitting behind another firewall, so I dont need the linux one on. It may be that you do – so think carefully about this. If you want to turn it off then run the command system-config-securitylevel-tui. Choose to disable the firewall and SELinux.
  3. Move to a static ip. Life is a lot easier when using Putty and WinSCP if you know that the ip address of your server isn’t going to change all the time. To do this run system-config-network. In the edit a device params section you can choose your network card, and set DHCP off and use static IP addresses instead. Make sure its in the same subnet that your router expects, and that it is an ip that your router will not allocate out itself. Your subnet mask is almost certainly and your gateway is the IP of your router ( for me). Once you have done this go into the Edit DNS configuration section and add the primary dns servers. If you want to edit things by hand the files the utility changes are in /etc/sysconfig/networking/profiles/default.
  4. Turn off the services you dont need. You can stop and start individual services using the service command, and see the status with service --status-all. You can also turn services on and off for a given run level using the chkconfig command. Some examples would be.

    chkconfig --list

    service --status-all

    service sendmail stop

    service sendmail start

    But you can also just use the ntsysv command to get a list of all the services and turn off the ones you dont need. Ones to turn off for the time being are:

    • anacron (unless you plan to cron a backup job when the machine may be off)
    • apmd
    • autofs
    • bluetooth
    • cups
    • firstboot
    • gpm
    • hidd
    • kudzu
    • netfs
    • nfs/nfslock
    • pcscd
    • portmap
    • rpcgssd
    • rpcidmapd
    • sendmail
    • yum-updatesd

    If you aren’t planning to use cron then crond and anacron can be turned off too (this has the advantage that they do a lot of logging). Services can (should) be turned off for level 2, and level 5 as well using the command ntsysv --level 2 (see here for what the various levels mean)

  5. We dont want the access time written on files mounted under /. This is because it forces a write to the disk when we don’t really need one. This can be turned off by editing the /etc/fstab file and changing the first line to:
  6. /dev/VolGroup00/LogVol00 / ext3 defaults,noatime,nodiratime 1 1

  7. If you are using a laptop drive (as I am) as the main drive you need to turn off the power management. The laptop drive has very aggressive power saving options, including unloading the read / write heads. On a journalling file system this will kill the drive off fairly quickly. See here for details. Anyway we need to turn off the power management on the drive to a less aggressive setting, so first find out what the drive you have installed is mapped to:

    [root@tranquilpc etc]# fdisk -l

    Disk /dev/sda: 40.0 GB, 40007761920 bytes
    255 heads, 63 sectors/track, 4864 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 13 104391 83 Linux
    /dev/sda2 14 4864 38965657+ 8e Linux LVM

    At this point there is only one drive installed – from the output it is /dev/sda (the numbers represent partitions, and can be ignored). So to make the power management be a lot less aggressive add:

    /sbin/hdparm -B254 /dev/sda

    to the end of the /etc/rc.d/rc.local file.

  8. On a new system you’ll probably need a fair few updates – so run yum to upgrade the software and make sure you have the latest of everything – just say yes when it asks if its ok:

    [root@tranquilpc etc]# yum upgrade

  9. There will be a lot of logging on a linux box – and in general every message will spin up the hard disk. This can be toned down a bit with a logging option – edit /etc/syslog.conf and change :

    *.info;mail.none;authpriv.none;cron.none /var/log/messages


    *.info;mail.none;authpriv.none;cron.none -/var/log/messages

  10. This only applies if you have a realtek 8111 network card (as the BBS2 that I bought does). You can check your card by doing:

    [root@tranquilpc ~]# lspci | grep Ether
    01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)

    Here you can see that the card is a RLT8111/8168. However if you check modprobe you can see that we have eth0 on a different module.

    [root@tranquilpc ~]# grep eth /etc/modprobe.conf
    alias eth0 r8169

    More to the point if you check this page you’ll see that the card wont work with the out of the box drivers in CentOS. You can take your pick of the 3 solutions offered on that page – the one I went for seemed easiest. First install the ELRepo repository:

    root@tranquilpc ~]# rpm -Uvh http://elrepo.org/elrepo-release-0.1-1.el5.elrepo.noarch.rpm
    Retrieving http://elrepo.org/elrepo-release-0.1-1.el5.elrepo.noarch.rpm
    warning: /var/tmp/rpm-xfer.cGD2k0: Header V3 DSA signature: NOKEY, key ID baadae52
    Preparing… ########################################### [100%]
    1:elrepo-release ########################################### [100%]
    [root@tranquilpc ~]# rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org

    Then install the module package:

    [root@tranquilpc ~]# yum --enablerepo=elrepo install kmod-r8168
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirrors.dedipower.com
    * updates: mirrors.dedipower.com
    * addons: mirrors.dedipower.com
    * extras: mirrors.dedipower.com
    elrepo | 951 B 00:00
    primary.xml.gz | 29 kB 00:00
    elrepo 97/97
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    --> Running transaction check
    ---> Package kmod-r8168.i686 0:8.012.00_NAPI-1.el5.elrepo set to be installed
    --> Finished Dependency Resolution

    Dependencies Resolved

    Package Arch Version Repository Size
    kmod-r8168 i686 8.012.00_NAPI-1.el5.elrepo elrepo 29 k

    Transaction Summary
    Install 1 Package(s)
    Update 0 Package(s)
    Remove 0 Package(s)

    Total download size: 29 k
    Is this ok [y/N]: y

    Then edit your modprobe config in /etc/modprobe.conf and update it to use r8168 (NOT r8169):

    alias eth0 r8168


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at WordPress.com.

%d bloggers like this: