Linux on the Toshiba Satellite M35X-S114

Author: Michael Minn (see www.michaelminn.com for current contact info)

January 15, 2009


Describes how to set up Fedora Core 9 Linux on a Toshiba Satellite M35X-S114 notebook computer.


1. Introduction

The following document describes how I set up Fedora Core 9 Linux on a Toshiba Satellite M35X-S114 notebook computer. The Toshiba M35X-S114 is an entry-level laptop manufactured in early 2005 with the following specs:

All of the internal hardware is currently supported under this Linux distribution, although some components require additional configuration or drivers. Toshiba's frequent offerings have often involved multiple extremely similar models and incremental (rather than revolutionary) changes from earlier models. As such, various parts of this document may apply to a wide variety of Toshiba models. I am providing this information to help others avoid the problems I encountered. The definitive source for Linux laptop information is the Linux on Laptops Page.

This document assumes some minimal UNIX/LINUX knowledge. I provide no guarantees for any procedures stated in this document. If you're using an older distribution, you might find helpful info in my Fedora Core 2 or Fedora Core 5 pages. You're more than welcome to e-mail me if you've got a problem, but I can't guarantee a prompt or helpful reply. Like many things in the Linux world...you're on your own. I would, however, appreciate any errata that you can point out so I don't mislead anyone else.


2. Memory Upgrade

This machine ships with 256MB of memory, of which 64MB is shared with the video chip. A memory upgrade will improve performance dramatically, especially with memory intensive applications like OpenOffice and Gimp. Memory can be purchased from numerous vendors online and comes on small SODIMM boards. In 2007, 256MB cost $30 and 1GB costs around $100. Although the machine can accept up to 2GB (two 1GB modules?), for most folks, performance will be acceptable with a 256MB upgrade (for a total of 512MB) and pretty much optimal with a 1GB upgrade (1.2GB total). The open memory slot is located in a small, vented compartment on the bottom of the machine.


3. Fedora Linux Install

Fedora is a free version of Red Hat Linux that is similar to Red Hat's commercial Linux releases, without the customer support or stability. I've been using Red Hat since v6.2 in 2000, although each release adds more unpleasant quirks that make it less suitable for laptops than for servers. If you have no specific reason to use Fedora, you might be better served by using Ubuntu which has a much easier package management system.

Fedora includes support for all the important hardware in this machine, so installation is fairly straightforward if you have some basic Linux knowledge. I am including my installation choices here for your reference.

Burn a Fedora CD: Fedora is available from the Fedora Project website (and a number of mirror sites) as ISO image files that can be used to burn CDs. While Fedora is still available for the old-style installation as a complete multi-CD (or DVD) set, I chose to go with the single live CD install with the option to do network installs of additional software packages later over the Internet.

Split your NTFS Partition: If this is a Windoze machine that you are planning on setting up for dual boot (where you can choose to boot up in Windoze or Linux), you will need to split your NTFS Partition to free up disk space for installing Linux. The process is a bit complicated and is described at the bottom of this page. If you don't need a Windoze side, it would be easiest to just blow away your Windoze partition and make it a Linux-only system.

Boot from the live CD: Insert the Fedora Live CD and reboot. While booting, press F12 to choose to boot from the CD-ROM/DVD Drive. I got numerous errors of the type listed below while the image was first loading from the CD drive, but they didn't seem to affect the install:

	end_request: I/O error, dev sr0, sector xxxx
	Buffer I/O error on device sr0, logical block xxxx

I also had a problem with my first boot attempt that the touchpad stopped working. However, a USB mouse hotplugged in fine and when I just rebooted and tried again, the touchpad worked fine.

The Live CD will take around 3 minutes to load. When given the login prompt, accept the "Automatic Login" default.

Start the Install: Double click the "Install to hard drive" icon on the desktop. You should get a splash screen - click next.

Keyboard: Choose the one right for you - defaults to U.S. English

Network Setup: Clich the checkbox so that both network devices are "enable on boot". Accept the manual hostname localhost.localdomain and choose no misc settings.

Time Zone: Where you go, there you are. Unclick system clock uses UTC because Windoze prefers the clock use local time. This can be changed later, if you desire, in the /etc/sysconfig/clock file.

Root Password: Choose something memorable, yet difficult to guess. Numbers, punctuation and mixed upper/lower case should all be used. Write this down somewhere safe 'cause it's pretty much impossible to recover a root password.

Disk layout: If you are creating a dual-boot system or installing to upgrade an existing Linux installation, you should choose "create custom layout". This will bring up a graphical partition editor.

Assuming you have two existing partitions after splitting your NTFS partition, you can delete /dev/hda2 and use the free space to create your Linux partitions. I chose to use partitioning from a previous installation and my partition table is as follows. The swap space sizing was recommended by the installer (around 2x my RAM of 512MB). I choose to use separate root and /home partitions (to permit easier recovery in the event of a disk problem) and do not use Logical Volumes (which are of value primarily to multi-user systems).

	/dev/sda
		/dev/sda1    		ntfs	 6676MB
		Free				    7MB
		/dev/sda2	/boot	ext3	   94MB
		/dev/sda3	/	ext3	 4997MB
	/dev/hda4 (extended - inserted automatically)
		/dev/hda5	swap		  957MB
		/dev/hda6	/home	ext3	25423MB

When you've triple-checked that it is what you want, write partition table.

Boot Loader: Accept the defaults.

Installer Runs: The installer will begin after the boot loader configuration with no additional warning - perhaps a reaction to the obsessive prompting of Microshit's Vista (tm). The installation takes five to ten minutes and will end with a screen indicating "Installation Complete"

Reboot: You should now shutdown the live Fedora version and reboot from the hard drive. On my shutdown, the screen went blank and the machine never powered off - strange. Holding down the power button for a few seconds forces the machine off, and then you can reboot.

Firstboot: When you reboot, the Firstboot program will run with some additional configuration and a bit of legalese. You can avoid all this by clicking CTRL-ALT-BACKSPACE, which will kill the program and X and put you at the system terminal.

Firstboot doesn't go away until you run it or disable it as a service:

	mv /etc/rc3.d/S99firstboot /etc/rc3.d/K99firstboot
	mv /etc/rc5.d/S99firstboot /etc/rc5.d/K99firstboot

You may notice the system doing lots of disk and internet access at this point. Probably doing automatic updates!?

Adding a User: For security reasons it is generally a bad idea to spend alot of time running as superuser. Therefore, you should create a regular user(s) that you can log in as and have less fear of accidentally damaging some system files. The useradd and passwd commands create a new user name and give it a password:

	useradd <username>
	passwd <username>

Reboot to make sure everything is set up for normal operation.


4. Wireless Networking

The Atheros AR5005GS Wireless Network Adapter (802.11b/g) in this machine has a lspci listing:

	02:02.0 Ethernet controller: Atheros Communications Inc. 
		AR5212/AR5213 Multiprotocol MAC/baseband processor (rev 01)

It is supported by the madwifi driver, which is not available from the Fedora repository. Although there are RPMs packages available, I found it difficult to figure out what needed to be installed and it was easier just to compile from source.

Download the latest release linked on the madwifi homepage. Decompress, make and install:

	tar -zxvf madwifi*
	cd madwifi*
	make install
	/sbin/depmod

Create the interface links and scripts:

	/sbin/modprobe ath_pci
	/usr/local/bin/wlanconfig wlan0 destroy
	/usr/local/bin/wlanconfig wlan0 create wlandev wifi0 wlanmode sta
	sudo /sbin/ifconfig wlan0 up
	sudo /sbin/iwlist wlan0 scan

Startup at Boot: The network script created for this device specifies that the interface should be started at boot time. As a security measure (or if you usually use the ethernet interface rather than wireless), you may want to set it up not to start on boot. Edit the /etc/sysconfig/network-scripts/ifcfg-wlan0 file and change the ONBOOT line:

	ONBOOT=no

Manual Start: The interface can be manually started with the ifup command:

	/sbin/ifup wlan0

The wlanconfig destroy step is critical since if wlan0 already exists, wlanconfig create may give you a message like:

	wlanconfig: ioctl: Operation not supported

Note that in previous versions, the interface was known as ath0 rather than wlan0. I'm not sure where this change occurred, but there is a message from udev in the system log (dmesg):

	udev: renamed network interface ath0 to wlan0

Attempting to wlanconfig, ifconfig or iwlist ath0 (which no longer exists) will give messages like the following:

	/usr/local/bin/wlanconfig ath0 create wlandev wifi0 wlanmode sta
	wlanconfig: ioctl: Input/output error

	/sbin/ifconfig ath0 up
	ath0: unknown interface: No such device

	/sbin/iwlist ath0 scan
	ath0  Interface doesn't support scanning.

If you do an ifconfig, you may notice additional wireless devices named wifi0 or wmaster0. These are virtual devices that are not actual usable network interfaces.

	wlan0     Link encap:Ethernet  HWaddr 00:11:F5:5C:A9:14  
	          inet addr:10.250.15.53  Bcast:10.250.15.255  Mask:255.255.255.0
        	  UP BROADCAST MULTICAST  MTU:1500  Metric:1
	          RX packets:47 errors:0 dropped:0 overruns:0 frame:0
	          TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
	          collisions:0 txqueuelen:1000 
	          RX bytes:13119 (12.8 KiB)  TX bytes:31306 (30.5 KiB)

	wmaster0  Link encap:UNSPEC  HWaddr 00-11-F5-5C-A9-14-F4-6F-00-00-00-00-00-00-00-00  
	          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
	          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
	          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
	          collisions:0 txqueuelen:1000 
	          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

5. Sound

The most serious problems I had with this machine and Fedora 9 is getting multimedia (sound and motion video) to work. If you use the machine straight out of the box as it's designed you might be OK. But if you do any radical tweaks (like getting rid of the desktop - see below), you may encounter some problems getting everything working again.

In the following instances, packages can be installed over the web from the Fedora repository using the yum command:

	yum install <package>

Packages installed directly from downloaded RPM files are installed with the rpm command:

	rpm -i <package.rpm>

PulseAudio: Fedora 8 started using PulseAudio, an audio server daemon that permits sharing and management of audio devices. It's integrated into the desktop but really it's just unnecessary overhead, especially if you do heavy sound work like multitrack audio. It is easy enough to remove, but the tough part will be getting the underlying ALSA sound system working again.

	yum remove pulseaudio alsa-plugins-pulseaudio

This will pull off a number of related dependencies:

	pulseaudio-libs-glib2-0.9.10-1.fc9.i386
	gstreamer-plugins-pulse-0.9.5-0.5.svn20070924.fc9.i386
	pulseaudio-libs-0.9.10-1.fc9.i386
	pulseaudio-utils-0.9.10-1.fc9.i386
	(pavucontrol)
	pulseaudio-core-libs-0.9.10-1.fc9.i386

ALSA: For better or worse, the Advanced Linux Sound Architecture (ALSA) has replaced the somewhat simpler (but still problematic) Open Sound System (OSS). Removing Pulse Audio breaks ALSA and some tweaks are needed to get it back working again.

alsa.conf: Edit the /etc/alsa/alsa.conf file and comment out any lines containing pulse (put a pound sign in column one):

	# "/etc/alsa/pulse-default.conf"

Then, replace this line...

	pcm.default cards.pcm.default

...with this line so the default sound device is card 0 (the internal sound chip)

	pcm.!default {
	    type hw
	    card 0
	}

Then, link that config file to the standard location used by the ALSA library:

	ln -s /etc/alsa/alsa.conf /usr/share/alsa/alsa.conf

Config file inaccessibility can cause error messages like this:

	asound -l

	**** List of PLAYBACK Hardware Devices ****
	ALSA lib control.c:909:(snd_ctl_open_noupdate) Invalid CTL hw:0
	aplay: device_list:216: control open (0): No such file or directory
	ALSA lib control.c:909:(snd_ctl_open_noupdate) Invalid CTL hw:1
	aplay: device_list:216: control open (1): No such file or directory
	ALSA lib control.c:909:(snd_ctl_open_noupdate) Invalid CTL hw:2
	aplay: device_list:216: control open (2): No such file or directory

Device Protections: The ALSA library uses a group of device special files in the /dev/alsa directory. By default, access to those devices is limited to the root, so normal user programs aren't able to access them when using the ALSA library functions to play sound. That may give you errors line these:

	asound -l

	aplay: device_list:207: no soundcards found...

UDEV is the service that runs at boot time to create those device files and you can modify the ALSA rules file so it creates the device with read/write access to everyone. Add the ", MODE="0666" to the end of each line in the file /etc/udev/rules.d/40-alsa-rules:

	KERNEL=="controlC[0-9]*",       NAME="snd/%k", MODE="0666"
	KERNEL=="hwC[D0-9]*",           NAME="snd/%k", MODE="0666"
	KERNEL=="pcmC[D0-9cp]*",        NAME="snd/%k", MODE="0666"
	KERNEL=="midiC[D0-9]*",         NAME="snd/%k", MODE="0666"
	KERNEL=="timer",                NAME="snd/%k", MODE="0666"
	KERNEL=="seq",                  NAME="snd/%k", MODE="0666"
	KERNEL=="mixer0",               SYMLINK+="mixer", MODE="0666"
	KERNEL=="dsp0",                 SYMLINK+="dsp", MODE="0666"
	KERNEL=="audio0",               SYMLINK+="audio", MODE="0666"

At this point, running the aplay ALSA player program should give you something line this:

	$ aplay -l

	**** List of PLAYBACK Hardware Devices ****
	card 0: I82801DBICH4 [Intel 82801DB-ICH4], device 0: 
	  Intel ICH [Intel 82801DB-ICH4]
	  Subdevices: 1/1
	  Subdevice #0: subdevice #0
	card 0: I82801DBICH4 [Intel 82801DB-ICH4], device 4: 
	  Intel ICH - IEC958 [Intel 82801DB-ICH4 - IEC958]
	  Subdevices: 1/1
	  Subdevice #0: subdevice #0
	card 1: Modem [Intel 82801DB-ICH4 Modem], device 0: 
	  Intel ICH - Modem [Intel 82801DB-ICH4 Modem - Modem]
	  Subdevices: 1/1
	  Subdevice #0: subdevice #0

alsamixer is the mixer program for ALSA. All devices are muted at boot time by default, so to play something, you need to start the alsamixer program and unmute the master and PCM channels.

Test: You should now be able to play an audio file with aplay. Further information on ALSA troubleshooting is available on this excellent page:

http://alsa.opensrc.org/index.php/TroubleShooting

Further info on disabling Pulse Audio is available from:

http://www.nabble.com/F8.-How-to-disable-pulseaudio-td13783714.html

MPlayer: While Flash video should work fine with X installed as it is, if you want to watch DVDs or Windoze Media streams on the web, you will need MPlayer.

The problem is that Red Hat, as an increasingly viable corporate entity, assiduously avoids supporting anything that even remotely has any DRM concerns that might awaken the M$-Beast. So Mplayer, MP3 support and some of the supporting libraries are not available from the trusty Red Hat repository.

Compilation of MPlayer from source code will not necessarily catch missing libraries, giving you no video and errors line:

	Can't open /dev/fb0: No such file or directory

Thankfully, FreshRPMS.net comes to the rescue with an RPM of MPlayer that will warn you about missing libraries. A link to the most recent RPMS can be found on the MPlayer homepage. Download and try to install the RPM:

	rpm -i mplayer-1.0-0.44.rc2.fc9.i386.rpm

At this point you will get a list of unresolved dependencies. I found some of them in the Fedora repository and the rest on livna-dl.reloumirrors.net

	libXext
	libcaca (fedora)
	SDL (fedora)
	aalib-libs (fedora - libaa.so)
	arts (fedora - libartsc.so)
	nas (fedora - libaudio.so)
	jack-audio-connection-kit (fedora - libjack.so)
	libdca (libdca.so)
	libdca-devel
	libdvdnav (fedora - libdvdnavmini.so.4)
	libmv4v2 (fedora)
	faac, faac-devel (libfaac.so.0)
	giflib (fedora - libgif.so.4, libungif.so.4)
	lirc, lirc-libs (liblirc_client.so.0)
	libmad, libmad-devel (libmad.so.0)
	lame, lame-devel, lame-libs (libmp3lame.so.0)
	x264, x264-devel (libx264.so.59)
	xvidcore (libxvidcore.so.4)
	mplayer-fonts (freshrpms)

mplayer-fonts never quite worked for me, and since it was the last dependency, I just used the --force option to force rpm to install.

When you finally get it to install, you should be able to play pretty much any kind of audio or video file with the mplay command. A plethora of additional options are described on "man mplayer".


6. Installation Tweaks

sudo: Folks who use Ubuntu are used to having the sudo command configured so they can run configuration programs as superuser without having to su or re-login. The sudo configuration file can be modified with the /sbin/visudo command. Find the commands section and add your username to it. If your username was joeplumber, you would add one line like the root line:

	## The COMMANDS section may have other options added to it.
	##
	## Allow root to run any commands anywhere
	root       ALL=(ALL)       ALL
	joeplumber ALL=(ALL)       ALL

CD and Flash drives: If you get rid of the desktop, the automount service is not available and you will need to modify /etc/fstab to permit user mounting. Add the following two lines to the bottom of the file:

	/dev/sdb1	/mnt/flash	vfat	noauto,user,exec  0  0
	/dev/sr0	/mnt/cdrom	iso9660 noauto,ro,user  0  0

Then create the mount points for the drives:

	mkdir /mnt/flash /mnt/cdrom

Newly inserted disks/devices can then be mounted with the mount command:

	mount /mnt/flash

makewhatis: If you ever use the whatis or man -k commands to search for a man page for a command, you should run makewhatis to build the database.

Text Login. I prefer to see what's going on with my machine rather than have the boot messages hidden behind a glitzy bitmap. Therefore, I have configured my machine to boot in run level 3 (text mode) rather than run level 5 (X windows mode). This will give you a command line prompt for login. The configuration above (with no KDE or GNOME) will do this automatically, but you can do this at any time. As superuser, edit the /etc/inittab file and change the line:

	id:5:initdefault:

	to

	id:3:initdefault:

If you chose text login mode, you will be given a VGA login prompt when you initially boot Linux. After you login, you type startx to start the X Windows desktop. Be aware that the screen will go completely black for a few seconds while X starts.

Unneeded Services. To reduce boot time, improve system performance and enhance security, unneeded services should be turned off. Service startup scripts are located in /etc/init.d and linked in various /etc/rcX.d files. Links that start with an 'S' are enabled, links starting with 'K' are disabled. You can disable a service by changing the first letter of the link name to 'K'.

Below is a list of services that were turned on by default that I turned off in /etc/rc3.d:

Cron Scripts. A program called anacron runs system administration programs on a daily, weekly and monthly basis. Some of the default cron tasks are more appropriate to more complex systems and since some are quite disk intensive, they can cause unpleasantness if they start running in the middle of something critical.

The configuration file is /etc/anacrontab runs the script /usr/bin/run-parts, which in turn points to the directories containing other scripts, /etc/cron.daily and /etc/cron.weekly. Don't touch tmpwatch (which cleans out unused files in the /tmp directory), logrotate (which cleans up old system logs) or prelink (which prelinks libraries to speed startup time). I moved the disabled scripts to a newly-created /etc/cron.hold directory:

SELinux Issues: Security-Enhanced Linux (SELinux) is enabled on Red Hat systems by default and manages a complex set of security contexts. When set up correctly, it is fairly transparent, but it's caused me strange permission errors in the past and you can just disable it by changing a line in the /etc/sysconfig/selinux file from enforcing to:

	SELINUX=disabled

Some Additional Packages: While the live CD contains a fairly extensive set of useful utilities, it's a much less robust group than Ubuntu. You will undoubtedly need to add additional packages. Packages can be installed over the network from a repository with:

	yum install <package>

The package database on the Fedora website doesn't seem to be complete and when looking for the exact name for a package, I've found it easier to just look directly at a repository directory, such as this one at Portland State. RPMs of source code are in a separate subdirectory.

Some packages I added:

Upgrade Firefox: Fedora 9 ships with Firefox v3.0b5 (v3.0-0.60.beta5.fc9), a buggy Beta release. You will want to upgrade, mainly because of security issues and also the fact that _blank links open in a new tab rather than a new window. Updating from the Fedora repository with yum is the simplest option:

	sudo yum update firefox

It is also possible to install via the tar.bz2 file directly from the Mozilla Website. Remove the old firefox (the rpm AND the copy under your /home directory) and install the new version:

	sudo rpm -e firefox-3.0-0.60.beta5.fc9.i386
	rm -rf ~/.mozilla
	bunzip2 firefox-3.0.4.tar.bz2
	tar -xvf firefox*.tar
	sudo mv firefox /usr/local
	sudo ln -s /usr/local/firefox/firefox /usr/local/bin/firefox

Since the Flash player is located in the firefox directories, you will need to reinstall. Unfortunately, Flash 10 (only current versions seem to be available from the Adobe Website and it crashes alot and very unpredictably. If you can find a copy of Flash 9, that will probably work much better for you. Get the tar.gz version for Linux. Don't mess with the RPM or install script - just create the plugins directory and copy the flashplayer plugin library into it.

	tar -zxvf install_flash_player_9_linux.tar.gz
	sudo mkdir /usr/lib/firefox-3.0.4/plugins
	sudo mv install_flash_player_9_linux/libflashplayer.so /usr/lib/firefox-3.0.4/plugins

Windoze Partition. If you left an NTFS partition on the drive at install time it is possible to mount the partition for read/write access with NTFS-3G. The RPM is available from the Fedora repository.

	yum install ntfs-3g

If you did a partition split, the NTFS partition is probably /dev/sda1, but use fdisk to check for certain:

	/sbin/fdisk -lu

	Disk /dev/sda: 40.0 GB, 40007761920 bytes
	255 heads, 63 sectors/track, 4864 cylinders, total 78140160 sectors
	Units = sectors of 1 * 512 = 512 bytes
	Disk identifier: 0x387b3af4

	   Device Boot      Start         End      Blocks   Id  System
	/dev/sda1   *          63    13672511     6836224+   7  HPFS/NTFS
	/dev/sda2        13687380    13880159       96390   83  Linux
	/dev/sda3        13880160    24113564     5116702+  83  Linux
	/dev/sda4        24113565    78140159    27013297+   5  Extended
	/dev/sda5        24113628    26073494      979933+  82  Linux swap / Solaris
	/dev/sda6        26073558    78140159    26033301   83  Linux

Add a line to /etc/fstab describing how to mount the device:

	/dev/sda1   /mnt/windoze     ntfs-3g    rw,defaults,umask=0000 0 0

Create a mount point directory and mount:

	mkdir /mnt/windoze
	mount /mnt/windoze

7. TrueType (tm) Fonts

The X window server contains native support for TrueType (tm) fonts, although installing them via the command line is a bit more cumbersome than with an installer program or package. If you've got some on a Windoze box, TrueType fonts tend to look quite a bit better than the fonts that come with the distributions. And if you're doing any web development, you need them to have at least a guess as to what your pages look like on a Windoze box.

Create a directory for your fonts in the shared font directory and copy your .ttf font files into that directory:

	sudo mkdir /etc/X11/fontpath.d/truetype
	sudo cp your-fonts/*.ttf /etc/X11/fontpath.d/truetype

Then run mkfontscale to create the fonts.scale file and mkfontdir to create the fonts.dir files used by the X server. You should also change the owner of all the files to root to avoid permission problems. The mkfontscale and mkfontdir steps are critical if you want to be able to list your fonts with xlsfonts or other legacy X applications. Note that mkfontscale replaces the older ttmkfontdir command (which is no longer included in Fedora distributions):

	cd /etc/X11/fontpath.d/truetype
	sudo mkfontscale
	sudo mkfontdir
	sudo chown root:root *

You can check to verify the fonts are loading by starting an X application (like gimp) or use the xlsfonts command:

	xlsfonts | less

The listing will likely be long, but if the fonts are loading correctly, you will see X font names like these (for Arial and Garamond, respectively):

	-monotype-arial-medium-i-normal--0-0-0-0-p-0-iso8859-1
	-monotype-arial-medium-i-normal--0-0-0-0-p-0-iso8859-10
	-monotype-arial-medium-i-normal--0-0-0-0-p-0-iso8859-15
	-monotype-arial-medium-i-normal--0-0-0-0-p-0-iso8859-2

	-monotype-garamond-medium-i-normal--0-0-0-0-p-0-iso8859-1
	-monotype-garamond-medium-i-normal--0-0-0-0-p-0-iso8859-10
	-monotype-garamond-medium-i-normal--0-0-0-0-p-0-iso8859-15
	-monotype-garamond-medium-i-normal--0-0-0-0-p-0-iso8859-2

Problems with X finding fonts: Linux also keeps fonts in subdirectories of /usr/share/fonts and they can be seen by many applications, such as gimp and OpenOffice. However, in Fedora some older X applications and the X font listing utility xlsfonts will not look in those directories. Doing an xset -q will show the current X configuration, including the Font Path:

	xset -q

	Pointer Control:
	  acceleration:  2/1    threshold:  4
	Screen Saver:
	  prefer blanking:  yes    allow exposures:  yes
	  timeout:  600    cycle:  600
	Colors:
	  default colormap:  0x20    BlackPixel:  0    WhitePixel:  16777215
	Font Path:
	  catalogue:/etc/X11/fontpath.d,built-ins
	Bug Mode: compatibility mode is disabled
	DPMS (Energy Star):
	  Standby: 1200    Suspend: 1800    Off: 2400
	  DPMS is Enabled
	  Monitor is On
	Font cache:
	  Server does not have the FontCache Extension
	File paths:
	  Config file:  /etc/X11/xorg.conf
	  Modules path: /usr/lib/xorg/modules
	  Log file:     /var/log/Xorg.0.log

It is possible to append a separate directory to the font path using xset, although the setting change is lost when you reboot your computer. The xset +fp command can be added to your .xinitrc file, although the simplest course of action is probably just to copy them to a subdirectory of the existing system font directory.

	fc-cache -f -v .
	xset +fp /usr/share/fonts/truetype/windoze
	xset q

8. Motif Window Manager (MWM)

As an old-school Unix guy, I've never found desktops to be the most comfortable way to work. I actually prefer typing commands rather than using the mouse to hunt and peck. Helps the carpal tunnel in my right hand as well. However, X Windows is still essential for graphical applications and useful for multiple terminal windows.

Therefore, I use the very simple Motif Window Manager which is included with OpenMotif, an implementation of the ancient Motif widget set. The Motif Window Manager provides, as its name implies, window management capabilities. I use it by itself without the KDE or Gnome desktops. While you don't get a start menu or the ability to leave icons on your desktop, that way of working has always struck me as sloppy anyway. Use of only a window manager speeds boot time and reduces complexity.

For some licensing reason, OpenMotif is no longer available in the Fedora repository. LessTif is available, but I have found its implementation of mwm a bit problematic (no alt-tab key to move between windows). So, you will need to download an RPM from the ICS FTP site.. You will also need the libXp.

	yum install libXp
	rpm -i  openmotif-2.2.3-2.i386.rpm

.xinitrc is a file that is executed when X is started. Create a .xinitrc in your home directory (/home/<username>) and type the following lines. This creates a single terminal window, puts a clock window at the bottom of the screen, sets the "desktop" color to blue and starts the window manager. When you type "startx", from the text login, it will start an xterm, in which you type commands to start other programs. You can create additional windows from a popup menu when you right-click on the desktop.

	xterm &
	xclock -d -update 1 -geometry +819+710 &
	xsetroot -solid navy
	exec mwm

9. CD Burning Problems

CD Burning under Linux has always been an adventure and is especially unreliable with the Matshita UJDA760 DVD/CD-RW drive in this machine. The situation got even more complex in 2006 when a group of Debian developers got in a dispute over the CDDL license that prickly developer Jörg Schilling chose for his cdrtools (cdrecord) package and decided to fork development at v2.01.01 into cdrkit (wodim). While the wodim command is aliased as cdrecord and maintains its general syntax, it provides less functionality and (with its roots in an older version of cdrtools) is more buggy. Fedora followed the Debian precedent and includes cdrkit rather than cdrtools.

Probably the best course of action is to uninstall cdrkit (wodim and genisoimage RPMS) and install cdrtools from source. To uninstall you will need to do a --nodeps because the cdrkit commands are used by some GUI programs:

	rpm -e --nodeps wodim-1.1.6-11.fc9.i386
	rpm -e --nodeps genisoimage-1.1.6-11.fc9.i386

Download a source tarball from the cdrtools website and compile it. I chose version 2.01.01a53. There is no configure step needed and you can ignore the warning messages issued during the compile:

	tar -zxvf cdrtools*
	cd cdrtools
	make install

cdrtools places commands in /opt/schily/bin (where Sun puts them). To make them available within the normal Linux PATH, soft link them into /usr/bin:

	ln -s /opt/schily/bin/mkisofs /usr/bin/mkisofs
	ln -s /opt/schily/bin/cdrecord /usr/bin/cdrecord

One error that cdrkit (and older versions of cdrtools also seemed to have) was failures burning disks in the fixating step (i.e writing the table of contents). I had this problem frequently (and erratically) under Fedora Core 5, but the problem seems less pronounced with the newer version of cdrtools:

	Fixating...
	Errno: 5 (Input/output error), close track/session scsi sendcmd: no error
	CDB:  5B 00 02 00 00 00 00 00 00 00
	status: 0x2 (CHECK CONDITION)
	Sense Bytes: 70 00 04 00 00 00 00 0A 00 00 00 00 09 00 00 00
	Sense Key: 0x4 Hardware Error, Segment 0
	Sense Code: 0x09 Qual 0x00 (track following error) Fru 0x0
	Sense flags: Blk 0 (not valid) 
	cmd finished after 24.401s timeout 480s
	cmd finished after 24.401s timeout 480s
	wodim: Cannot fixate disk.
	Fixating time:   27.654s

Even disks that have been burned successfully have problems mounting. Not sure whether that is the genisoimage version of mkisofs or some problem with the device driver, but the only solution seems to be to reboot the machine, at which point the newly burned disk(s) mounts fine. This is the error issued during mounting:

	sudo mount -t iso9660 /dev/sr0 /mnt/cdrom

	mount: block device /dev/sr0 is write-protected, mounting read-only
	mount: wrong fs type, bad option, bad superblock on /dev/sr0,
	       missing codepage or helper program, or other error
	       In some cases useful info is found in syslog - try
	       dmesg | tail  or so

A dmesg listing of the system log file gives this error message:

	dmesg | tail

	attempt to access beyond end of device
	sr0: rw=0, want=68, limit=4
	isofs_fill_super: bread failed, dev=sr0, iso_blknum=16, block=16

Even if a disk seems to burn and mount fine, I would suggest you always try doing a complete copy of the disk to make sure that all the data is actually readable from the disk. Sometimes an "input/output error" will occur while copying a bad file.

	cp -va /mnt/cdrom temp

10. Dial-up Modem

Since I no longer have any need for dialup, I haven't made any effort to get the POTS interface working. Below are the instructions I used with Fedora Core 5.

The internal modem built into this machine is a Winmodem, which is basically a cheap analog telephone interface with the actual modem signal processing provided in software drivers. The Intel 82801DB (ICH4) AC'97 Modem Controller (rev 03) (BCP\VEN_8086&DEV_24C6&SUBSYS_00011179&REV_03\3&61AAA01&0&FE) uses an Agere Systems codec SIL27 subsystem and is supported by the cumbersome slmodem driver, not the slick ltmodem driver.

Download / Compile / Install: Download the most recent Smartlink modem driver (I used slmodem-2.9.11-20060727.tar.gz). Decompress and make:

	tar -zxvf slmodem*
	chmod slmodem*
	make
	make install

Start: As the name implies, the slmodemd uses a daemon that must be started before dialing. You must load the slamr kernel module before starting the daemon. You can include this in a script to simplify connection.

	/sbin/modprobe slamr
	/usr/sbin/slmodemd --country=USA /dev/slamr0

When you start the daemon, it should issue a message like:

	SmartLink Soft Modem: version 2.9.10 Mar 23 2005 11:52:23
	symbolic link `/dev/ttySL0' -> `/dev/pts/2' created.
	modem `slamr0' created. TTY is `/dev/pts/2'
	Use `/dev/ttySL0' as modem device, Ctrl+C for termination.

As the message indicates, the modem device provided by the daemon is /dev/ttySL0.

Dial: Finally, you need a program to dial out and establish the PPP connection. I use wvdial, an excellent, no-nonsense command line program that can be used to test and use the modem. All you need is one simple config file. Given the modem setup above, the following is my /etc/wvdial.conf file. You should modify the username/password to the one given by your ISP. Note the Carrier Check parameter is necessary to use this driver

	[Dialer Defaults]
	Modem = /dev/ttySL0
	Phone = 1-212-202-6884
	Username = (ISP username)
	Password = (ISP password)
	Carrier Check = no

If you prefer a dialer with a GUI, kppp seems relatively popular and also uses the wvdial.conf file.


11. Splitting your Windoze Partition

I split my Windoze partition to make this a dual boot system when I first bought it. I haven't gone through the procedure since, but I am including the older instructions in case you need to execute this task.

This machine comes with Windoze XP Home Edition (tm) preinstalled on a single NTFS partition. Since the supplied installation CD will only contains a ghost image to completely rebuild the drive the way it shipped from the factory, you will have to use NTFSRESIZE and FDISK to get the existing partition resized and space freed up for the Linux partitions.

This the most precarious and unpleasant set of tasks in Linux installation on this machine. If you want to have a Linux-only, Windoze-free system, you can skip this section.

Download ntfsresize: The ntfsresize utility can be used to split an NTFS partition. Some distributions come with ntfsresize integrated into their installers, but Fedora does not. You should download the statically-linked binary, which should have a link on the ntfsresize info page. (old link here). Decompress the tarball (tar -zxvf) and burn ntfsresize onto CD. If you have an external floppy drive you can also copy ntfsresize to a floppy. USB flash drives will not work with Red Hat Linux rescue mode (no usb-storage driver), although if you use a CD distro like Knoppix for this procedure, you can save yourself a CD.

Defragment: Boot up into Windoze and run the Disk Defragmenter to defragment your hard drive. The utility is located in Programs -> Accessories -> System Tools -> Disk Defragmenter. If you haven't done much on your Windoze partition, this should complete in under five minutes. Supposedly this step is no longer necessary, but you may want to avoid taking unnecessary chances.

Change Boot Order: As you're rebooting, press F12. This will allow you to select the CD-ROM as the boot device. You also have the option of going into the PhoenixBIOS Setup Utility and moving the CD-ROM first in boot order.

Boot Into Linux Rescue Mode: Insert the Fedora installtion CD #1 into the CD drive and reboot. When you get a boot: prompt, type

	boot: linux rescue

When asked, you can skip to the command shell without mounting the existing partitions.

Mount the ntfsresize CD: Remove the Fedora installation CD and insert the CD you created that contains ntfsresize. Although the kernel supports the CD drive, the device file must be created in order to mount the CD.

	sh-2.05b# mkdir /cdrom
	sh-2.05b# mknod /dev/hdc b 22 0
	sh-2.05b# mount /dev/hdc /cdrom

Verify Hard Drive: Verify with FDISK that Linux is seeing the hard drive.

	sh-2.05b# fdisk -l /dev/hda

You should get something like this, showing the single bootable NTFS partition:

	   Device Boot    Start       End    Blocks   Id  System
	/dev/hda1   *         1      4864  39070048    7  HPFS/NTFS

Find the Split Location: Use NTFSRESIZE to find out where you can split the partition. If everything is good, you will get a message indicating where to split

	sh-2.05b# /floppy/ntfsresize -i /dev/hda1

	You could resize at 5819277312 bytes or 5820MB (freeing 34188MB)

NTFSRESIZE will warn you if there is a problem. If you plan on using your Windoze side for anything non-trivial, you should leave some extra space for data and new programs.

Do a Test Run:

	sh-2.05b# ./ntfsresize -n -s7000M /dev/hda1

	The read-only test run ended successfully.

I didn't have a problem, but if you get one, you should probably not ignore it, or you will mess up your Windoze installation.

Resize the Partition: The -s option is the size in MB of the new partition. You should use whatever number you got from the earlier run of ntfsresize. You will get one additional prompt to verify you want to continue and you should get a completion message in a minute or so.

	sh-2.05b# /floppy/ntfsresize -s7000M /dev/hda1

Start FDISK: Finally, we repartition with FDISK. Be careful here as a mistake will corrupt your hard drive, forcing you to have to reinstall Windoze and start from the beginning.

Start fdisk and use the "p" command to list the current partitions:

	sh-2.05b# fdisk /dev/hda

	Command (m for help): p

Delete Windoze Partition Entry: You should get a listing of the first and only partition: /dev/hda1. Delete it with the "d" command. If any other partitions are listed, delete them as well.

	Command (m for help): d

Recreate the Smaller Windoze Partition Entry: Create a new primary partition for the Windoze partition you resized earlier. It should be the same size as the resize value. Note the + before the size.

	Command (m for help): n
	Command action
	   e   extended
	   p   primary partition (1-4)
	p
	Partition number (1-4): 1
	First cylinder (1-4864, default 1): 1
	Last cylinder or +size or +sizeM or +sizeK (1-4864, default 4864): +7000M

Modify its type to NTFS (type 7) and make it the boot partition ("a" command)

	Command (m for help): t
	Partition number (1-4): 1
	Hex code (type L to list codes): 7
	Changed system type of partition 1 to 7 (HPFS/NTFS)

	Command (m for help): a
	Partition number (1-4): 1

Create A New Partition With Free Space: Create a new partition for the remaining free space on the drive. You need to create this partition, or Windoze will undo your resizing and stick it back onto the first partition.

	Command (m for help): n
	Command action
	   e   extended
	   p   primary partition (1-4)
	p

	Partition number (1-4): 2
	First cylinder (1096-4864, default 1096): (choose default)
	Last cylinder or +size or +sizeM or +sizeK 
		(1-4864, default 4864): (choose default)

	Command (m for help): t
	Partition number (1-4): 2
	Hex code (type L to list codes): 7
	Changed system type of partition 2 to 7 (HPFS/NTFS)

Verify and Write: List the partitions with the "p" command. You should see a listing of the two partitions with the dimensions you specified. If you're satisfied, make the committment and write the new partitions:

	Command (m for help): p

	Device	   Boot	Start	End	Blocks	   Id	System
	/dev/hda1  *	1	1095	8795556	   7	HPFS/NTFS
	/dev/hda2  *	1096	4864	30274492+  7	HPFS/NTFS

	Command (m for help): w
	The partition table has been altered!

	Calling ioctl() to re-read partition table.
	Syncing disks.

Reboot: CTRL ALT DELETE to reboot to Windows to check everything is right . CHKDSK will automatically run when you reboot and Install New Devices will run at startup to assign the new drive letter. If everything is good in Windoze, you can move on to the installation.

Numbers can have meaning because of what we bring to them. Their value, and meaning, may change over time. But when all that matters is the numbers as numbers, you have zeros. (Doug Glanville)