Installing Debian Sarge on an Alienware Area 51m 5500

Introduction
Prerequisites
Knoppix
Debian
Partitioning
Boot loader
Finalizing
X settings
Resolution
Touchpad
Screenshot
Ethernet
Wifi
Mounting

^ Introduction

In the following description, I explain how I installed Debian Sarge on my laptop. Some of the issues that I had to overcome on the way include

  • Resizing an NTFS partition
  • Installing a Linux boot loader in a safe place.

Up to the point where the Debian base system is installed, nothing in this document is particular to my laptop. It should work equally well with any other laptop or desktop computer. The general idea should also be portable across various Linux distributions. I only assume there is a single HDD in the system.

Following the instructions below, getting Debian Sarge up and running on your laptop should not take more than, roughly, two hours, including the time to read the present document, but not including steps such as, e.g., defragmenting your Windows partition, which can be time-consuming.

Specs:

  • Alienware Area-51M 5500, 766 15.4" REV40A8
  • Seagate Momentus 100Gb 5400rpm HDD
  • Nvidia FX Go5700 with 128Mb module
  • Pentium 4 3.4GHz with 512Kb L2 cache and 800MHz front side bus
  • Realtek RTL8139 NIC
  • 2X Corsair 512Mb DDR PC3200 SO-DIMM VS
  • No floppy drive
  • No internal wireless card.

Some of the monitor specs are as follows

  • Brand and Model: Samsung 15.4 WSXGA LTN154P1
  • Resolution: 1680*1050
  • Response time (Rise + Fall) 25 milliseconds (although I have also seen 35 milliseconds on the Alienware website
  • Viewing Angle: Up 50, Down 50, Left 65, Right 65
  • Frequency: 60 Hz Vertical, 64 kHz Horizontal
  • Number of Colors: 262 k
  • Contrast: 300 to 1
  • Brightness: 185 (cd/m2)
  • Ratio: 16/10
  • Screen Area: 331 mm * 207 mm

Here are a few pictures of the laptop

My system came with Windows XP pre-installed and I did not want to give it up. XP resides in the only partition on the disk, which takes the whole disk. Debian wants to have a partition ready for installation and will not shrink your Windows partition (usually equipped with NTFS filesystem).

Some people recommend using specific tools to resize the NTFS partition, such as Bootit-ng, Partition Magic, etc. Although some, like Bootit-ng, are free, I would not recommend this method as it is likely to corrupt the MBR if anything goes wrong. It did go wrong in my experience for reasons that were not explained in the manual. By luck, the situation could be fixed. Keep in mind that if anything goes wrong at that stage, you will loose all your data if you are lucky. If you are unlucky, you will also be unable to boot anything directly. You might have to boot your computer using other means (such as the Knoppix live CD that we will shortly use) or you might have to have a backup copy of your MBR. Unfortunately, the Debian netinst CD does not allow you to boot an operating system already installed on your computer. Other distributions, such as SuSE, make provision for this.

Installing the Linux boot loader on the MBR is also likely to cause trouble as, for instance, Windows will overwrite it if it goes into hibernation. You will then be unable to boot your Linux system. Below, I describe the steps I followed to overcome these two difficulties.

^ Prerequisites

Before moving on, you should have

  • A CD drive
  • A floppy drive or a USB storage device (e.g., a flash drive).

Optionally, you will also need

  • A CD burner
  • A broadband internet connection.

If you do not have a CD burner, you may either use someone else's burner, buy the necessary CDs (Knoppix and Debian) or use someone else's. If you do not have a broadband internet connection, you will need to have a full Debian CD set and the Knoppix CD by other means.

I recommend that you defragment your disk from within Windows before carrying on.

I could not recommend enough to read the Debian installation manual and other documentation on the Debian website

www.debian.org.

You may want to print out the manual to have it handy while installing.

If something goes wrong, the LinuxQuestions website is a fabulous resource. It has a forum dedicated to Debian.

www.linuxquestions.org.

^ The cool Knoppix tool

Aside from the more obvious purposes for which it was designed, Knoppix is a fantastic tool for more specialized purposes. We will use it to resize your NTFS partition. Knoppix is a live Linux CD, meaning that it resides on a CD-ROM and does not install anything on your computer. It has fantastic hardware auto-detection abilities and comes in handy in many situations. Browse to

www.knopper.net/knoppix/index-en.html

download the latest Knoppix iso image and burn it to a CD. Make sure you create a bootable CD when you burn the iso image.

If you don't have a CD burner of your own, I strongly suggest that you find someone who has one (at work, at school, at the library) as using Knoppix instead of other tools will be a tremendous time, trouble and stress saver. You can also obtain the Knoppix CD via snail mail

www.knopper.net/knoppix-vendors/index-en.php.

I have Knoppix 3.6. Any later version will do. It is possible that some earlier versions will do too, I just haven't tried. It is also likely that any other live Linux CD will do, I haven't tried either. By the way, Knoppix is based on Debian.

^ Obtaining Debian

I chose the netinst flavor of Debian installation as it involves a minimal download. You can burn it to a CD-RW and not waste a CD-R. The base system will be included and all other packages will be downloaded from the internet later. Surf to

www.debian.org/distrib/netinst

and download the latest iso for netinst. Burn it to a CD, making sure you are making it bootable.

Alternatively, the Debian team offers you to download floppies, in case you do not have a CD burner or do not want to burn a CD. All should work equally well with the floppy flavor of netinst. In the sequel, I simply assume that you are using the CD image. If all else fails, you can buy a set of Debian CDs from your local vendor or check

www.debian.org/CD/vendors.

If you have an internet connection at home, I strongly recommend that you use the ethernet port instead of, say, a wireless card. Debian Sarge did not auto-detect my wireless card but configured my wired access with DHCP in a matter of seconds. Configuring your wireless adapter after installation should be relatively easy, if your adapter is supported. After the base system installation, Debian will want you to select a mirror near you to download other packages you may want.

^ Partitioning your disk

If necessary, reboot your computer and go in your BIOS to set the CD drive as the first bootable device, so we can boot from CD.

Reboot your computer with the Knoppix CD in the drive. At the boot prompt, hit F1 for options. I use 'linux26' to boot a recent 2.6 kernel. Other options will let you choose a window or desktop manager. Let Knoppix auto-detect your hardware. In no time, you should have an X system up and running.

Open a command prompt and type

qtparted

to launch a graphical user interface for parted—a program able to manage partitions on your hard disk. Identify the NTFS partition (it should be the only one on your disk). In most cases, the disk will be identified as /dev/hda. Right-click on the partition and say resize. This will launch resizentfs. A dialog window pops up asking you what the new size should be. Introduce the new size.

I have a 100Gb hard drive and estimated that I would not need more than 30Gb for my Windows work. I thus said 30G  and clicked Ok. Once finished, say Commit either in the menu or by clicking on the floppy icon. Close qtparted.

It will help to see what settings Knoppix used for your system. Look into /etc/X11 and search for a file called xorg.conf or XF86Config. Print it if possible, copy it to a floppy, a pen drive, or write down what Knoppix used for your monitor. In particular, you will want to know what the horizontal and vertical refresh rates are as well as the resolutions permitted. The lines we are looking for are similar to the following.

Section "Monitor"
        Identifier      "Alienware Area51-M 15.4"
        HorizSync       31.5-67
        VertRefresh     60-60
        Option          "DPMS"    "true"
        Modeline "1680x1050@60" 147.14 1680 1784 1968 2256 1050 1051 1054 1087 -
HSync +VSync
EndSection

with possibly several Modeline lines. The values may differ. The above are actually the ones we will want to set up later.

Exit Knoppix by logging out of the X system.

^ Installing Debian

Reboot your computer, this time with the Debian netinst CD in the drive. Follow the instructions there to install Debian on the fresh partition that you just freed. You will want to split that disk space into two or more partitions. For instance, you can refer to the Debian manual, or

debian.linbyte.com/cfdisk.php.

You need a swap partition of size roughly twice your RAM, but usually not more that 1Gb, and a primary partition with ext3fs filesystem. The latter partition must be bootable. One way to proceed is to first create the swap partition and to ask for it to be placed at the end of the partition that you freed earlier. Next, you can create the ext3fs partition to fill the whole remaining space. If your laptop will mostly be a single-user system, not having the system files, log files and home directory in separate partitions will not hurt. Now your partition table should look something like

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>                  <dump>  <pass>
proc            /proc           proc    defaults                   0       0
/dev/hda3       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda2       none            swap    sw                         0       0
/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto             0       0

Write down your partition table as you will need to know what the logical name of the primary partition is. In this example, it would be /dev/hda3. Let Debian go on with the installation, and when prompted, introduce your monitor's refresh rates as you gathered them from Knoppix. When Debian asks you where you want to install the boot loader, move on to the next step.

^ The boot loader

You have the choice between LILO and GRUB. GRUB is the default, and we will choose it. Whichever you should choose, DO NOT choose to install it on the MBR (Master Boot Record) of your disk, even if Debian says that it is safe to do so. Chances are that this will either prevent your Windows from booting, or that Windows will later overwrite the MBR, annihilating your boot loader.

If you have a floppy drive and your computer can boot from it, you have the option of installing the boot loader on a floppy. This works fine but means that you need to always have that floppy with you. If this is the option you choose, you are finished with these directions.

An alternative is to install the boot loader on the partition on which you just installed the base Linux system (/dev/hda2 in our example—the ext3fs partition). Sure, your computer cannot yet boot from that partition but we are going to precisely work around this. Once GRUB is installed on /dev/hda2, let Debian finish its base installation. It will then ask you to boot into your fresh Linux system to finalize things. You are unable to do that yet. So instead, we will use Knoppix!

^ Windows goes GRUB

Reboot the computer with the Knoppix CD in the drive. If you have a floppy drive that Knoppix detected, prepare a fresh floppy. I don't have one, so I used my USB key instead. Make sure to plug the USB key before Knoppix boots.

(If you don't have a USB key either, but you have a digital camera, I bet that you can use your camera instead and use the card inside for this next operation. I haven't tested this though. An external USB or FireWire hard disk would do too. If all else fails, you could burn a CD but it would be wasteful. In Knoppix, you can typically do that with K3B.)

Open a command prompt and if necessary, mount your floppy or USB storage device. Log in as root by saying su at the prompt—in Knoppix, you will not need a root password. The first 512 bytes of your fresh ext3fs partition say where to find your boot loader on the disk. We make a carbon copy of them using the command:

dd if=/dev/hda2 of=linuxboot.bin bs=512 count=1.

You now have a file called linuxboot.bin 512 bytes in size in the current directory.

If necessary, make sure your floppy or USB drive is writable (you can change this in Knoppix by right-clicking on the relevant icon and choosing Actions). Copy linuxboot.bin to the floppy or USB key by saying

mcopy linuxboot.bin /mnt/floppy

or

mcopy linuxboot.bin /mnt/sda1.

If you are not sure where your device has been mounted, type mount at the prompt.

Note: Make sure to use mcopy and not cp in the previous command.

Unmount the floppy or USB key if necessary and exit Knoppix. Reboot the computer into Windows. Insert your floppy or USB key that contains linuxboot.bin and copy this file into C:\

In C:\ there is a text file called boot.ini which may be hidden if you are using Windows Explorer. It is probably also read-only. Remove the read-only flag on this file, edit it with a text editor and append the line

C:\linuxboot.bin="Debian Sarge"

to it. If you wish, you can reset the read-only flag.

^ Finilazing the Debian base installation

You are finished. Now at boot time, the Windows boot loader (NTLDR) will find your linuxboot.bin and give you the option between Windows XP and Debian Sarge.

Reboot your computer, as if you were going to boot Windows. The menu in which you can select Debian Sarge is displayed. Choose it, and GRUB come up! GRUB gives you the choice of booting using the default kernel, possibly other kernels, or in failsafe mode. Choose the default kernel, and now, Debian can finalize it installation. When the time comes to configure your video card and the X Windows system, move on to the next step.

^ X settings

This Alienware system comes with one of two video cards; the ATI Mobility Radeon 9600 Pro and the Nvidia FX Go5700. If you have the ATI card, there are instructions on how to configure it at

xoomer.virgilio.it/flavio.stanchina/debian/fglrx-installer.html.

The card was successfully configured on this system with Debian as reported at

www.nd.edu/~mclarke3/area51m.html.

The list of cards supported by the official Nvidia driver is listed at appendix A of

ftp://download.nvidia.com/XFree86/Linux-x86/1.0-7174/README.txt.

I have the Nvidia FX Go5700 and had good hope to configure it easily given Nvidia's commitment to writing (non GPL) Linux drivers. For licensing reasons the Nvidia drivers are not included on the Debian CD. They can be found in the non free section of Debian repositories, but we will rather download them directly from Nvidia's website.

We must first select one of the drivers available at installation time. In the present case, it is the vesa driver that we want.

Note: There also is a driver called nv. This and vesa are the two choices for Nvidia cards. Depending on your model, you must choose one or the other. The nv driver will not do for this card. Any resolution will do for now—we will fine-tune it in a moment. Start X using the command startx, start any browser and download the latest Nvidia driver from

www.nvidia.com/object/linux.html.

Start the Synaptic Package Manager and install the kernel headers corresponding to the kernel you are running. To find out which ones to install, open a terminal and type uname -a. My system responds

Linux alien 2.6.8-2-386 #1 Mon Jan 24 03:01:58 EST 2005 i686 GNU/Linux

The headers that I need to install are headers for kernel 2.6.8-2-386. Install those appropriate for your kernel. Next you need to create a symbolic link that points to the newly installed headers so the Nvidia installer can find them (substitute the appropriate kernel version):

ln -s /usr/src/kernel-headers-2.6.8-2-386 /lib/modules/2.6.8-2-386/build

Exit X and stay in console mode. If you can't exit X without the computer shutting down or rebooting, switch to a console by pressing [Ctrl]+[Alt]+F1, log in as root and type /etc/init.d/gdm stop (gdm might be kdm or xdm in your case).

Extract the Nvidia driver in a fresh directory and, as root, execute the main installation script NVIDIA-Linux-x86-1.0-7174-pkg1.run. I use version 1.0-7174 of the driver. You should download the latest one. The installer may tell you that it needs to download a kernel patch and recompile the kernel. Let it do it, it only takes a few moments. Once installed, run the following command as root to reconfigure the X display

dpkg-reconfigure xserver-xfree86

Change to /etc/X11, edit your XF86Config-4 or xorg.conf, look for a section called "Modules" and make sure that it contains the line

Load "glx"

and that the following lines either do not appear or are commented out

Load "dri"
Load "GLcore"

In the section "Device", make sure that the Driver is set to "nvidia". If there is a section called "DRI", comment it out entirely. Save the file and close it. At the prompt, type modprobe nvidia to load the module. My system responds

NVRM: loading NVIDIA Linux x86 NVIDIA Kernel Module 1.0-7174 Tue Mar 22 06:44:39 PST 2005

If you see a message about the kernel being tainted, you can safely ignore it. It is only for information purposes and indicates that the driver is not open source. It is now time to test the driver by typing startx at the prompt. The Nvidia logo should appear. Once the window manager loaded, open a terminal and type

% glxinfo | grep 'OpenGL'

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce FX Go5700/AGP/SSE2
OpenGL version string: 1.5.3 NVIDIA 71.74
OpenGL extensions:

If your output is different (i.e., does not mention NVIDIA), then some other program is taking care of OpenGL functionality and something has gone wrong in the installation. Start glxgears. You will be able to see the number of frames per second displayed by the card.

If something goes wrong, the driver fails to load or you experience problems, the first place to look is /var/log/XFree86.0.log or /var/log/Xorg.0.log. You may see in there why your driver was not loaded successfully. Read the Nvidia README.txt and browse the Nvidia Linux Forum.

Here is a list of other instructions to install the Nvidia drivers. They might help you find out what went wrong in the installation.

www.serios.net/content/debian/nvidia-display-drivers.php
www.linbyte.com/debian
home.comcast.net/~andrex/Debian-nVidia

^ Resolution settings

The 15.4" widescreen on this laptop can do 1680x1050 at 60Hz. Since this is an unusual resolution, it does not appear in the XFree86 database. This means that X needs a modeline to know how to render it. There are several modeline generators on the web. If I had known

sh.nu/nvidia/gtf.php

in advance, it would have saved me days. KDE is absolutely beautiful at this resolution. To obtain it, edit once again your /etc/X11/XFree86-4 configuration file. The section called "Monitor" should look like

Section "Monitor"
        Identifier    "Alienware Area51-M 15.4"
        HorizSync     31.5-67
        VertRefresh   60-60
        Option        "DPMS"
        Modeline "1680x1050@60" 147.14 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +VSync
EndSection

Finally, your "Screen" section should refer to this modeline. Make sure it contains

Monitor "Alienware Area51-M 15.4"
DefaultDepth 24
SubSection "Display"
        Viewport 0 0
        Depth 24
        Modes "1680x1050@60"
EndSubsection

^ Touchpad settings

The laptop is equipped with a Synaptics touchpad. From any package manager, e.g., the Synaptic Package Manager (unrelated to the touchpad), make sure you download and install the xfree86-driver-synaptics touchpad driver. Once installed, read /usr/share/doc/xfree86-driver-synaptics/README.Debian and copy the InputDevice section to your /etc/X11/XF86config-4 configuration file.

^ Savior

Here is a screenshot showing what KDE looks like sshot.png. Here is my XF86Config-4.

^ Internet access via the ethernet port

If you have DSL or cable internet access at home, at work or anywhere, you will find that configuring networking interfaces in Debian is refreshingly easy and pleasant. I recommend to read all about it in the Debian reference manual at

www.debian.org/doc/manuals/reference

Everything happens with the scripts ifup, ifdown and the configuration file /etc/network/interfaces. When using DHCP for dynamic IP assignment, the fantastic tool DHCPDISCOVER takes everything in charge and will take care of all the configuration. Plug an RJ45 cable into your ethernet port and say

ifup eth0

^ Wireless

My laptop did not come with a mini-PCI wireless card integrated. I already had a PCMCIA Netgear WG511T adapter. I knew this adapter was supported by the madwifi driver as it has an Atheros chipset. I had tested this adapter is SuSE 9.1 where all worked well.

There is currently no Debian package for madwifi. I fetched it from the website, compiled it from source, installed it against my running kernel, loaded it and the whole process took less than 10 minutes. First, retrieve the latest source from the madwifi CVS tree. In a fresh directory, say

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi co madwifi

Change to the newly created madwifi directory and, as root, type make and make install. Note that for this step, you need to have the kernel headers installed. If you do not yet have them in /usr/src, fetch them with the Synaptic Package Manager. Your driver modules are ready. Now, as root, edit /etc/network/interfaces to insert

# PCMCIA wireless adapter
iface ath0 inet dhcp
        wireless-essid your-ssid

# Get the wireless adapter to hotplug
mapping hotplug
        script grep
        map ath0

The first part of this addition declares the ath0 interface as received a dynamic IP and specifies the network ID you are using. The second part maps the interface so it is brought up when the wireless adapter is hotplugged.

As root, load the required modules and bring up the interface

alien:# modprobe wlan
alien:# modprobe ath_hal
alien:# modprobe ath_pci
alien:# ifup ath0

Again, DHCPDISCOVER does all the work, you should now have an IP assigned to you and you should be up and running.

If you run into problems bringing up the wireless interface, make sure to check the documentation of the driver appropriate for your chipset. In my case, the chipset is an Atheros and the relevant driver is madwifi. Often, usenet discussion groups and google are your best friends. Make sure your kernel was compiled with all the necessary options. Most of the time these include CONFIG_NET_RADIO, CONFIG_NET_WIRELESS and CONFIG_HOTPLUG. For instance, the madwifi documentation requires

  • Wireless Extensions versions 14 or later (version 16 preferred)
  • Sysctl support
  • Crypto API support

^ Mounting your Windows partition and a USB pen drive

In order to have access to your Windows XP partition and possibly to a USB stick, log in as root, edit the file /etc/fstab and add the following lines to it

/dev/hda1       /media/winxp    ntfs    ro,user,noauto,umask=000   0       0
/dev/sda1       /media/sda1     vfat    rw,users,noauto            0       0

The mount point of the Windows partition will be /media/winxp and that of the USB stick will be /media/sda1. As root, issue the command

mount /media/winxp

and you should be able to access anything on your Windows partition by exploring the directory /media/winxp. When you are finished, issue

umount /media/winxp

Note: this previous command was umount, not unmount. When you insert the pen drive into a USB port, it should be mounted automatically. If it isn't, issue the corresponding mount command.

TuxMobil - Linux on Laptops, Notebooks, PDAs and Mobile Phones Valid HTML 4.01 Transitional Valid CSS! If you found something I should correct, please let me know.