Thursday, April 30, 2009

Install Ubuntu 9.04 on used laptop

My father just sent me a laptop that is a few years old. It has 1gb of ram and a 100gb hard drive with intel graphics.

Almost everything worked OK but I found a few problems that I needed to fix. The flash videos didn't work full screen and the hard drive was spinning down too often.

After installing and fixing those 2 things everything seems to work right. It boots fast and suspend,wireless,web cam,graphics,network and sound all work good.

Here is the step by step guide of how I got it running.

1. Boot from ubuntu 9.04 live usb or cd

Select:
Try Ubuntu without any change to your computer

2. Open terminal windows from Applications-Terminal

type:
sudo passwd root
to setup a root account, then type:
su


3. Create Partitions

start fdisk
fdisk /dev/sda
Press d to delete all partitions
Press n to add a new partition
Press p for primary partition
Partition number 1
Select defaults for First cylinder
Set size to +20G for Ubuntu
Press n to add a new partition
Press p for primary partition
Partition number 2
Set size to +30G for Gentoo
Press n to add a new partition
Press p for primary partition
Set size to +2G for Swap
Press n to add a new partition
Press p for primary partition
Use the rest of drive for data partition
Press t to change partition type
Select partition 3 for swap
change to swap type 82
Press w to write to disk and exit


4. Run Ubuntu Installer

Select defaults until partition screen then select Specify partitions manually

select /dev/sda1 by double clicking on it
set Use as: to ext3
check format the partition:
set mount point as /

select /dev/sda2
set Use as: to ext3
check format the partition:
leave mount point blank

select /dev/sda3
set Use as: to swap area

select /dev/sda4
set Use as: to ext3
check format the partition:
leave mount point blank

click on next to set up username and password then let it finish installing the system



5. Open terminal window and set root password

sudo gpasswd root
then
su

6. Fix drive spin down

edit:
/etc/hdparm.conf

add to end of file
hdparm -B 254 /dev/sda



7. Fix Intel 915 Graphics

I followed the instructions from the website shown below.

http://www.ubuntugeek.com/intel-graphics-performance-guide-for-ubuntu-904-jaunty-users.html


wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30-rc2/linux-headers-2.6.30-020630rc2-generic_2.6.30-020630rc2_i386.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30-rc2/linux-headers-2.6.30-020630rc2_2.6.30-020630rc2_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30-rc2/linux-image-2.6.30-020630rc2-generic_2.6.30-020630rc2_i386.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm2_2.4.9-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-intel1_2.4.9-1_i386.deb http://http.us.debian.org/debian/pool/main/x/xserver-xorg-video-intel/xserver-xorg-video-intel_2.7.0-1_i386.deb


dpkg -i linux-headers-2.6.30-020630rc2_2.6.30-020630rc2_all.deb linux-headers-2.6.30-020630rc2-generic_2.6.30-020630rc2_i386.deb linux-image-2.6.30-020630rc2-generic_2.6.30-020630rc2_i386.deb libdrm2_2.4.9-1_i386.deb libdrm-intel1_2.4.9-1_i386.deb xserver-xorg-video-intel_2.7.0-1_i386.deb



edit:

/etc/X11/xorg.conf

Section "Monitor"
Identifier "Configured Monitor
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection

Section "Device"
Identifier "Configured Video Device"
Driver "Intel"
Option "AccelMethod" "uxa"
VideoRam 261376
Option "FramebufferCompression" "false"
Option "Tiling" "false"
Option "EnablePageFlip" "true"
EndSection

#Enable clt-alt-backspace

Section "ServerFlags"
Option "DontZap" "false"
EndSection



8. Install Flash Player

apt-get install ubuntu-restricted-extras flashplugin-nonfree flashplugin-installer


9. Install Java

apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts


10. Install GCC Compiler and other misc software

apt-get install build-essential sensors-applet mplayer bum nautilus-open-terminal abiword xfmedia

11. Reboot

Monday, April 27, 2009

Ubuntu 9.04 Upgrade

Well Ubuntu 9.04 aka Jaunty Jackelope has been out for several days now and I have the time so I am going to try the upgrade via synaptic. Its better to upgrade by downloading the new cd and doing a clean install but I hate having to re-install all my applications so I have always upgraded via update-manager.

With 8.10 now on my Ubuntu partition I'm hoping that the upgrade goes smoothly but just in case it doesn't I am going to back it up from my Gentoo partition. I have Ubuntu installed on my sda2 partition so a simple 'dd' will suffice for a quick backup. I have enough room on my data partition but if you don't you can always backup to a usb drive.

I've heard there are problems with the older ATI cards with the new system so I'm going to prepare for that as well. Apparently the ATI catalyst version 9.4 doesn't support the card built into my 1 1/2 year old laptop so I plan on removing the ATI drivers from Ubuntu first then try to install the 9.3 version, which is the last version to support many of older chipsets.

So here goes...

Step 1 Backup

The most important step, I would not want to try the upgrade without an easy way to get back to the now working system.

Using dd to backup went smoothly as expected.
If you only have Ubuntu on your system you will need to boot from a live cd to do the backup.

dd if=/dev/ubuntu/ of=/path/file.img
on my system it is
dd if=/dev/sda2 of=/data/backups/ubuntu810.img

Backup any other config files you may want to save also. On my system I need to backup my grub boot file to preserve my multiboot settings..
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.save


Step 2 Reboot machine into Ubuntu

Easy step, no problems there.

Step 3 Remove ATI restricted drivers and restart the X server

Go to Main menu then System then Administration then Hardware Drivers. Select ATI/AMD proprietary FGLRX graphics driver and click Deactivate on bottom button.
Then alt-ctlr-backspace to reboot the server or just logout and back in.

Step 4 Update existing 8.10 software

You can use update-manager to update, but I choose Synaptic
Open Synaptic. Again System - Administration - Synaptic
Click on the Reload Button on top. When it is finished click on Mark All Upgrades button then click the Apply button and wait.
I am rebooting again, just to be on the safe side.


Step 5 Update to new 9.04 version

Open update-manager.







System - Administration - update-manager
Click on upgrade button next to New distribution release '9.04' is available. Click upgrade on the release notes screen that comes up and let it run the distribution upgrade. The upgrade tool shows that I have 1,810 files to download so I think I will go do some garden work. It will take a while.

I'm still waiting so I am posting what I have for now. Will try to update again tomorrow.

When I got back to the computer I found out my internet connection went down which forced me to start the update-manager from the start. I started it again and the same thing happened. It turned out to be a bad connection in the phone box. Now that is fixed it should be fine but it put me behind a day.

If there are any config files you have modified update-manager will ask if you want to keep your old version. I answered yes to preserve my menu.lst file which is used by grub to boot. That means it will boot using the old version of the kernel unless I edit the menu.lst and change the settings.

Select save obsolete packages

Step 6 Reboot to new system

Let update-manager restart your computer.

Step 7



Manually install ATI catalyst version 9.3
(I haven't been able to get this to work yet.)
I don't think this will ever work due to the xorg server upgrade and kernel so I set it up to run the open source radeon driver. While they work ok, its not as fast as the ati fglrx driver and mythtv doesn't work. However dual screens work better and they were easier so set up than with the proprietary driver.


Step 8 Reboot test and tweak new system

Step 9 Backup the upgraded system.

dd if=/dev/ubuntu/ of=/path/file.img
on my system it is
dd if=/dev/sda2 of=/data/backups/ubuntu904.img


The new upgrade is working well although there are still a few rough edges to straighten out on this laptop.

Sunday, April 26, 2009

Introduction - Getting started with GNU/Linux


I thought I would start my blogs with my personal Linux history. I started my computer hobby around 1983, even before that if you count digital electronics, but that is another story.

My first experience with linux was with Red Hat 6. I never did very much with it because I couldn't get many drivers for my hardware back then. Then around 2003 with the release of FedoraCore 1 I thought I would try linux again. While not as easy as today I was pleasantly suprised to find that I could get all my hardware working, even my tv card. The first several months I did a little distro hopping to find one that fit my needs. I tried Fedora , Ubuntu, Source Mage and finally, another source code based distro called Gentoo. I finally settled on Gentoo as my main distribution, although I kept an Ubuntu partition on my hard drive also. That was 2004 and I was finally windows free. Gentoo has worked out well for me, however it has had its rough spots but they are generally easier to troubleshoot and fix compared to the problems I have had with Ubuntu. Ubuntu is great for an easy install and to quickly try out various software, but because its a binary distro its quite a bit harder to customize to my liking.

If your just getting started with Linux its a good idea to make a small partition for your operating systems and use the rest for a data partition. That way its much easier to upgrade and backup your computer.

Linux has come a long way since I first tried Red Hat. There are many distributions out there now so it should be easy to find one that suits your needs with a little research at www.distrowatch.com or similar site.