Linux on the Toshiba U505-S2960

Author: Michael Minn (www.michaelminn.com)

1 January 2012

Describes how to set up an Ubuntu 10.4 operating system on a Toshiba Satellite U505-S2960 notebook computer.

1. Introduction

This page describes how to install 32-bit Ubuntu 10.04 LTS (Lucid Lynx) Linux operating system on a Toshiba U505-S2960 notebook computer.

This machine has some serious hardware issues (notably the fan and wireless card) and is not a very good Linux box with the distributions that are current as of this writing. It is also built as a multimedia machine and has too few USB ports if you use alot of peripherals. Although this is a 64-bit machine, 64-bit Ubuntu is not recommended for general use and you will want to use the 32-bit version of Linux. These problems persist from Ubuntu 9.10, as detailed in my Ubuntu 9.10 installation guide.

The machine that I purchased in December of 2009 features:


2. Install From CD

The install from CD is fairly straightforward and painless, except for partitioning. The following are my choices and you may need to choose other options depending on your situation.

This installation assumes that you will be building a system that can dual-boot into either Windoze or Linux. For systems that can run both simultaneously, you will need to explore virtualization software like VMWare.

Defrag: Prior to installing Linux, you should boot into Windoze at least once and defragment the drive. I'm not sure if this is still necessary to maximize available disk space, but it can't hurt.

Download and Burn: the current Ubuntu release CD image ISO from Ubuntu.com and burn it to a CD.

Boot from Install CD: Insert the boot CD into the CD-ROM drive and reboot. When the American Megatreds BIOS splash screen comes up press F-12 and choose CD/DVD P-1MATSHITADVD-RAM UJ862. The machine takes 3-5 minutes to load the OS from the CD-ROM. You can press ESC to view boot messages, although there aren't alot of meaningful ones issued anymore.

Initial Prompt: Choose the language of your choice and select "Install" NOT "Try".

Welcome: choose language and click forward.

Where are you?: select time zone.

Keyboard layout: Default is USA.

Prepare disk space: This step defines how you will partition your hard disk. The easiest choice is, "Install them side-by-side, choosing between them each startup." However, if you know what you're doing, choosing "Specify partitions manually," will allow you to set up separate root and home partitions, making future OS upgrades a bit easier. My steps:

This left me with the following partition table, which includes three residual (and mysterious) NTFS partitions.

	/dev/sda1  ntfs             1572MB
	/dev/sda2  ntfs   /windows  100000MB
	/dev/sda5  ext2   /boot     1019MB
	/dev/sda6  swap             4096MB
	/dev/sda7  ext4   /         29997MB
	/dev/sda8  ext4   /home     171908MB
	/dev/sda3  ntfs             11472MB

You should select format for / and /boot. You should also format /home unless you are upgrading from a previous version of Linux and want to keep your existing /home files. You should not format /windows (to preserve your Windoze installation).

Who are you?: These steps configure the name, password, and name of computer. Since you don't know how this info will be hacked, tou may not want to use real name. I named my computer localhost and require password for login.

Migrate documents and settings: Why?

Install: Kick it off and it takes around 25 minutes.

At the conclusion of the install, the installer will eject the CD and crash with the following message. It is simply the installer trying to access the disk it already ejected, and can be ignored.

	I/O error, dev sr0, section 507360

Reboot: Restart Ubuntu and you should be able to boot from the hard drive.

Update Your Package Repository: Once you get the machine on the internet, you should update your application package repository with a list of the latest security patches and repository updates. This may take a few minutes. You can get a command-line terminal from Applications->accessories -> terminal to execute the following command:

	sudo apt-get update

This particular combination of hardware and software release is a bit touchy, and some fairly important tweaks follow.


3. Fan Issues

The first thing you may notice about the machine is that the wrist rest gets really hot and the fan doesn't seem to be running. Apparently, there are issues with this particular BIOS and version of ACPI, which doesn't turn the fan on. There supposedly is a thermocouple that will force the fan on at an extremely critical temperature, but that is probably not something you want to verify.

The nasty workaround is to simply suspend and reawaken the machine once it starts getting warm:

	sudo pm-suspend

The BIOS apparently feels the heat on reawakening and turns the fan on. It stays on, but that allows you to continue to stay cool. You can check the temperature with the "sensors" command, with the -f option giving readouts in Farenheit for Americans who haven't caught up with the rest of the planet.

	sensors -f

	acpitz-virtual-0
	Adapter: Virtual device
	temp1:      +109.4°F  (crit = +226.4°F)                  

	coretemp-isa-0000
	Adapter: ISA adapter
	Core 0:      +84.2°F  (high = +185.0°F, crit = +185.0°F)  

	coretemp-isa-0001
	Adapter: ISA adapter
	Core 1:      +84.2°F  (high = +185.0°F, crit = +185.0°F)  

None of the fixes given in various forum threads ( 1, 2, 3, 4, 5, 6) seemed to work for me and it looks like this is something that will just have to wait for another release. The sensors-detect program finds the "EDID EEPROM" with a Intel Core family thermal sensor, but installing the suggested coretemp driver didn't do anything for me.


4. Wireless

This version of Ubuntu comes with a driver for the internal Realtek RTL8172 802.11b/g/n (the r8192se_pci module) that provides the network interface wlan0. However, the Ubuntu network manager seems to cause fatal problems with a variety of wireless drivers. Since I like to manually start and stop my interfaces anyway, I just uninstalled the network manager:

	sudo apt-get remove network-manager

The wireless network can be started with the command "ifup wlan0" and stopped with "ifdown wlan0". Don't forget to turn on the wireless switch on the front edge of the machine (next to the antenna graphic).

Access points can be displayed with the "iwlist wlan0 scan" command and configured with "sudo iwconfig wlan0 essid <ESSID>". If you use a specific ESSID regularly, you can add an entry for it to the /etc/network/interfaces file (replace ESSID with the name appropriate to your network):

	iface wlan0 inet dhcp
	wireless-essid <ESSID>

FYI: the network-manager issue vexed me for months until I read about it deep in a support thread. Notably, the chip would seem to try to connect to an AP, but immediately disassociate:

[ 1234.999078] rtl8192_SetWirelessMode(), wireless_mode:4, bEnableHT = 0
[ 1235.008234] SetHwReg8192SE():HW_VAR_AC_PARAM eACI:0:a425
[ 1235.008240] SetHwReg8192SE():HW_VAR_AC_PARAM eACI:1:a449
[ 1235.008244] SetHwReg8192SE():HW_VAR_AC_PARAM eACI:2:5e431c
[ 1235.008247] SetHwReg8192SE():HW_VAR_AC_PARAM eACI:3:2f321c
[ 1235.008254] Associated successfully
[ 1235.008256] normal associate
[ 1235.008270] Using G rates:108
[ 1235.008273] Successfully associated, ht not enabled(0, 0)
[ 1235.008277] === >rtl8192se_link_change():ieee- >iw_mode is 2
[ 1235.008282] rtl8192_update_cap(): WLAN_CAPABILITY_LONG_PREAMBLE
[ 1235.009600] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 1235.009716] dis associate packet! mode 2 code 3
[ 1235.009956] === >rtl8192se_link_change():ieee- >iw_mode is 2

Network Manager caused a similar deauthentication problem with the ATH5k driver on my EeePC:

[   51.403537] wlan0: authenticate with 06:01:12:ca:25:05 (try 1)
[   51.409057] wlan0: authenticated
wpa_supplicant[848]: No network configuration found for the current AP
[   51.409127] wlan0: associate with 06:01:12:ca:25:05 (try 1)
[   51.412362] wlan0: RX AssocResp from 06:01:12:ca:25:05 (capab=0x421 status=0 aid=59)
[   51.412371] wlan0: associated
[   51.413750] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   51.413859] cfg80211: Calling CRDA for country: US
[   51.414578] wlan0: deauthenticating from 06:01:12:ca:25:05 by local choice (reason=3)

5. Backlight / Screen Brightness

The screen backlight brightness is variable, although the current version of ACPI doesn't support changing it. However, it will erratically boot with only 25% brightness, which is a bit too dim for normal use. The fix is to add a kernel option that forces ACPI to use the vendor specific driver.

Edit the /etc/default/grub configuration file and add the following kernel options to GRUB_CMDLINE_LINUX_DEFAULT.

	GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"

Then run:

	sudo update-grub

On reboot, the machine should reliably boot with full screen brightness.

However, this may be a bit overwhelming, especially in contrast to older, dimmer LCD displays. The midtone (gamma) adjustment can be tweaked with xgamma. I put the following in my .xinitrc file in my home directory to set the values when X starts.

	xgamma -gamma .7

You can use xrandr --verbose to view other configurable display options and the range of available values. Unfortunately, the BACKLIGHT parameter no longer seems to work, so gamma is all you have if you have issues.


6. Burning DVDs

There are two command-line methods for burning data DVDs on this machine. Both of these methods assume you have all the files you want burned to the disk under a single directory named <directory>.

The older method is to use mkisofs (which is linked to genisoimage from the genisoimage package) to create an ISO-9660 filesystem image that can then be burned to a DVD using wodim (a forked version of cdrecord from the wodim package). The -r and -joliet-long options provide for preservation of long file names.

	mkisofs -joliet-long -r -o /tmp/cdimage <directory>
	wodim -v --dev=/dev/scd0 -data /tmp/cdimage
	rm /tmp/cdimage

The simpler one-command method is to use growisofs (from the dvd+rw-tools package) to burn the image directly to the DVD on the fly:

	growisofs -Z /dev/scd0 -R -J <directory>

The mkisofs/wodim combination seems to be a bit more foolproof than growisofs, perhaps since prebuilding a single image file reduced the possibility of buffer underflow that will kill your write and leave you with a coaster. However, a consideration for older, space-constrained systems is that it does temporarily require an extra 4.5 GB of disk space.

Sporadically I've had issues with growisofs giving an"input/output error" and dmesg lists a number of errors like the following:

	sr 4:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
	sr 4:0:0:0: [sr0] Sense Key : Illegal Request [current] 
	sr 4:0:0:0: [sr0] Add. Sense: Logical block address out of range
	sr 4:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 00 00 00 00 01 00
	end_request: I/O error, dev sr0, sector 0
	Buffer I/O error on device sr0, logical block 0

The write completion messages stop and the drive seems to cycle through different speeds before issuing the message. This can happen early or late in the write process.

The only way I've found to avoid this is when inserting the blank DVD into the drive, to wait a couple of minutes to let the drive read the media and stop spinning, then execute growisofs.

I have also not had this problem with the mkisofs/wodim method, so it may be a growisofs bug or specific problem with the Labelflash DVD drive in this machine. A quick google search will reveal other folks who've had this issue with other machines, which gives some indication that it may be a hardware-inspecific bug.


7. Removing the Splash Screen

I prefer to see what's going on with my machine rather than have the boot messages hidden behind the splash bitmap just in case there's a boot problem (which used to happen alot). Unlike RedHat, which provides a runlevel 3 text login, Debian distribution runlevels always start the GUI. So the process is a bit more complicated than changing /etc/inittab (which doesn't exist in Debian).

Ubuntu used GRUB 2. The old /boot/grub/menu.lst is replaced by a generated file with options specified in /etc/default/grub configuration file. The splash screen can be removed and text mode (non-graphical) booting can be enabled by editing that file and changing these lines:

	GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
	GRUB_HIDDEN_TIMEOUT=true

To...

	GRUB_CMDLINE_LINUX_DEFAULT="text acpi=noirq"
	GRUB_HIDDEN_TIMEOUT=0

Then run:

	sudo update-grub

After these changes, on boot you will see the system startup messages and then be greeted with a console login prompt. After logging in, you can use the startx command to start the graphical desktop.

	startx

8. Removing the Desktop

If you're hard core command line and don't want the clutter and delay of the Ubuntu desktop, you might consider getting rid of the desktop altogether and just using a window manager to manage xterms and X applications started from the xterms. This will speed your boot time a bit and get rid of some annoying background daemons.

Although I used the venerable Motif Window Manager (MWM) for a number of years (from the motif-clients package), this version of mwm locks up when X is started. So I switched to the ICE Window Manager, which has a few more features (like a task bar with graphical system monitoring) but is still fast and lightweight:

	sudo apt-get install motif-clients

.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 couple single terminal window, sets the "desktop" color to pleasant shade of greenish grey blue and starts the window manager. When you type "startx", from the text login, it will start an xterm, in which you can type commands to start other programs. You can create additional terminal windows from a popup menu when you right-click on the desktop.

The xgamma command changes screen contrast and is optional.

	xgamma -gamma .7
	xsetroot -solid "dark slate gray"
	xterm -geometry 128x24+10+10&
	xterm -geometry 128x24+10+375&
	exec icewm

9. TrueType Fonts

The X window server supports 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.

Unfortunately, the FontPath configuration that specifies the directories where fonts are located is compiled into the X binary and is not configurable. While "xset +fp" can add a directory to the font path, that setting is not permanent and is lost when you reboot. xset cannot be added to a local configuration file like .xinitrc. This is not a problem for newer applications that use fontconfig, but this may represent an issue for older applications that only use the X font paths. The kludge is to copy the fonts you want to add into one of the configured truetype font directories.

Copy the fonts into a shared font directory: You can do an "xset -q" to find the configured Font Paths for your X configuration:

	xset -q

Chose one of the directories listed in "Font Path" and copy your .ttf font files into that directory. In my case, I chose to use /usr/share/fonts/X11/misc. While you could create a new directory under /usr/share/fonts, fonts installed there would not be visible to xlsfonts or older X applications.

	sudo cp your-fonts/*.ttf /usr/share/fonts/X11/misc

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.

	cd /usr/share/fonts/X11/misc
	sudo mkfontscale
	sudo mkfontdir
	sudo chown root:root *

You can check to verify the fonts are loading by starting an X application (like gimp). The xlsfonts command lists fonts available directly from X and the fc-list command lists fonts available through fontconfig.

	xlsfonts | less
	fc-list | 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

10. Annoying cron Jobs

There are a couple of search database update tools that periodically run in the background and tank system performance for a few minutes while they execute. If you don't use these tools, you can uninstall them and save yourself the annoyance.

locate and mlocate are commands that can be used to search for files on your hard drive(s). They use a daily chron script (/etc/cron.daily/mlocate) that shows up in process lists as updatedb.mlocat. If you don't use this, remove the package:

	sudo apt-get purge mlocate

Similarly, apt-xapian-index is a maintenance tool for Debian software package information. This sporadically runs update-apt-xapian-index and also tanks system response at unexpected and undesirable times. You can make it go away by removing the package:

	sudo apt-get purge apt-xapian-index

Youth is a blunder, manhood a struggle, old age a regret. (Benjamin Disraeli)