Difference between revisions of "Installing Debian on a ThinkPad G41"

From ThinkWiki
Jump to: navigation, search
 
Line 21: Line 21:
 
After this I installed Debian using an official i386 Debian minimal bootable CD netinst image obtained from http://www.us.debian.org/CD/netinst/
 
After this I installed Debian using an official i386 Debian minimal bootable CD netinst image obtained from http://www.us.debian.org/CD/netinst/
  
When the CD booted I pressed the F3 key which gave instructions to type "expert26" at the boot prompt in order to install in expert mode using a more recent 2.6 Linux kernel.  I accepted the defaults for all questions except that when it asked about partitioning the disk I chose the option to "manually edit the partition table".  This is because I already partitioned the disk with QTParted above and created the swap and XFS filesystems I plan to use.  So in the manual partition setup section I simply told it to use hda2 as swap and to use hda3 as xfs, assign the mount point "/" to it, and to format the filesystem.  Once this is done the rest is simple.
+
When the CD booted I pressed the F3 key which gave instructions to type "expert26" at the boot prompt in order to install in expert mode using a more recent 2.6 Linux kernel.  I accepted the defaults for all questions except that when it asked about partitioning the disk I chose the option to "manually edit the partition table".  This is because I already partitioned the disk with QTParted above and created the swap and XFS filesystems I plan to use.  So in the manual partition setup section I simply told it to use hda2 as swap and to use hda3 as xfs, assign the mount point "/" to it, and to format the filesystem.  Once this is done the rest is simple.  When it asked about making Linux bootable directly from the hard disk, it is important to NOT chose the Grub boot loader since the version included with the installer has a serious problem dealing with XFS filesystems.  Choose Lilo instead and everything will be fine.
  
 
After the first reboot during the install it asks to set up apt sources.  I chose to use http and selected a local mirror in my country.  It then asked if I want to choose packages to install and I said no.  My philosophy is to install Debian with the minimal amount of stuff, get it working, and then later on install any other applications I want.  Also, if you plan on dist-upgrading from stable to testing or Sid then it is easier to do with only a minimal installation.
 
After the first reboot during the install it asks to set up apt sources.  I chose to use http and selected a local mirror in my country.  It then asked if I want to choose packages to install and I said no.  My philosophy is to install Debian with the minimal amount of stuff, get it working, and then later on install any other applications I want.  Also, if you plan on dist-upgrading from stable to testing or Sid then it is easier to do with only a minimal installation.
  
 +
 +
== Installing a few important packages ==
 +
 +
Here are a few important packages that it is good to install right away:
 +
  apt-get install less vim
 +
  apt-get remove --purge nvi
 +
 +
vim is a much better than nvi.  Less is much better than more which is installed by default.
  
  
Line 56: Line 64:
 
   fbpanel &  #run fbpanel
 
   fbpanel &  #run fbpanel
 
   exec openbox  # run openbox, our window manager
 
   exec openbox  # run openbox, our window manager
 +
 +
The next thing I did is immediately build my own kernel.  This involved installing:
 +
  apt-get install ncftp build-essential bin86 libncurses-dev bzip2 
 +
 +
I then used ncftp to retreive linux-2.6.12.tar.bz2 from ftp.kernel.org/pub/linux/kernel/v2.6
 +
 +
  cd /usr/src
 +
  ncftp
 +
        open ftp.kernel.org
 +
        cd pub/linux/kernel/v2.6
 +
        get linux-2.6.12.tar.bz2
 +
        bye
 +
 +
    tar -xjf linux-2.6.12.tar.bz2
 +
    cd linux-2.6.12
 +
    make menuconfig
 +
    ...
 +
    ...
 +
    make
 +
    make modules_install
 +
    cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.12
 +
    cp System.map /boot/System.map-2.6.12
 +
    vi /etc/lilo.conf
 +
          #stanza for image from lilo.conf
 +
          image=/boot/vmlinuz-2.6.12
 +
              label=2.6.12
 +
              read-only
 +
 +
    lilo

Revision as of 19:51, 25 August 2005

IBM does not provide the rescue/recovery CD set with this model so I suggest before anything else that you immediately boot into Windows and create the set. You could always order one from IBM and pay $45. The set from IBM consists of a "Rescue and Recovery" CD plus 6 "Product Recovery" CD's which contain the actual image that gets written to the hard drive. As mentioned in other places the default drive image contains two VFAT partitions: one large Windows XP partition and one smaller recovery partition. After creating the recovery CD set I recommend going into the BIOS and <a href="http://www.thinkwiki.org/wiki/PreDesktop_Area#Three_BIOS_options>setting the "IBM Predesktop Area" in the BIOS under "Security"</a> to "Disabled" so that it can be removed. It is pretty much useless.


Disk Preparation and Partitioning

If you want to keep the Windows XP partition you should seriously consider whether you want it to be VFAT or NTFS, because on the very first bootup of the system it will automatically run a command to convert from VFAT to NTFS. I recommend disabling the automatic conversion as per instructions <a href="http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2004-February/016069.html>here</a>, i.e.:

boot into Knoppix, mount the XP partition, and move the following files:

  windows/system32/convert.exe   
    -->  mv /target/windows/system32/convert.exe /target/windows/system32/convert_.ex_
  windows/system32/autoconv.exe
    -->  mv /target/windows/system32/autoconv.exe /target/windows/system32/autoconv_.ex_
  i386/convert.exe
    --> mv /target/i386/convert.exe /target/i386/convert_.ex_
  i386/autoconv.exe
    --> mv /target/i386/autoconv.exe /target/i386/autoconv_.ex_

Next, I ran the QTparted graphical disk partitioning tool to alter the partition layout of the drive. I deleted the recovery partition (partition 2) and shrunk the XP partiion to 8 GB. QTParted will correctly resize the XP partition regardless of whether it is VFAT or NTFS. Finally, I created a 2300 MB swap partition as the second partition and used the remainder of the disk (partition 3) as one large XFS filesystem for Linux. The reason I chose the high value for the swap partition size was so that it can accomodate suspend to disk, which requires a swap partition larger than the amount of installed RAM.

After this I installed Debian using an official i386 Debian minimal bootable CD netinst image obtained from http://www.us.debian.org/CD/netinst/

When the CD booted I pressed the F3 key which gave instructions to type "expert26" at the boot prompt in order to install in expert mode using a more recent 2.6 Linux kernel. I accepted the defaults for all questions except that when it asked about partitioning the disk I chose the option to "manually edit the partition table". This is because I already partitioned the disk with QTParted above and created the swap and XFS filesystems I plan to use. So in the manual partition setup section I simply told it to use hda2 as swap and to use hda3 as xfs, assign the mount point "/" to it, and to format the filesystem. Once this is done the rest is simple. When it asked about making Linux bootable directly from the hard disk, it is important to NOT chose the Grub boot loader since the version included with the installer has a serious problem dealing with XFS filesystems. Choose Lilo instead and everything will be fine.

After the first reboot during the install it asks to set up apt sources. I chose to use http and selected a local mirror in my country. It then asked if I want to choose packages to install and I said no. My philosophy is to install Debian with the minimal amount of stuff, get it working, and then later on install any other applications I want. Also, if you plan on dist-upgrading from stable to testing or Sid then it is easier to do with only a minimal installation.


Installing a few important packages

Here are a few important packages that it is good to install right away:

  apt-get install less vim
  apt-get remove --purge nvi

vim is a much better than nvi. Less is much better than more which is installed by default.


Setting up graphics

First, it is necessary to install the minimal essential components necessary to get the graphical environment working:

 apt-get install x-window-system-core

Then you need to set up the nvidia driver. The easiest way to do this is with the module-assistant utility:

  apt-get install module-assistant
  m-a prepare
  m-a a-i nvidia
  apt-get install nvidia-glx nvidia-settings
  echo nvidia >> /etc/modules
  modprobe nvidia
  dpkg-reconfigure xserver-xfree86  
  #if you are using Sid, then use dpkg-reconfigure xserver-xorg

At this point you should be able to start X from the command line with the startx command. But there it will not look very appealing. Install a window manager/desktop environment, e.g.,

  apt-get install openbox fbpanel

and then have these invoked when you run start X by creating a .xsession file in your home directory:

  #!/bin/sh
  # ~/.xsession: stuff to do when starting X
  #
  xsetroot -solid DarkSlateGrey  #set the background
  xset m 4 1  # increase the mouse sensitivity a bit, good for Trackpoints
  fbpanel &  #run fbpanel
  exec openbox  # run openbox, our window manager

The next thing I did is immediately build my own kernel. This involved installing:

  apt-get install ncftp build-essential bin86 libncurses-dev bzip2  

I then used ncftp to retreive linux-2.6.12.tar.bz2 from ftp.kernel.org/pub/linux/kernel/v2.6

  cd /usr/src
  ncftp
        open ftp.kernel.org
        cd pub/linux/kernel/v2.6
        get linux-2.6.12.tar.bz2
        bye
   tar -xjf linux-2.6.12.tar.bz2
   cd linux-2.6.12
   make menuconfig
   ...
   ...
   make
   make modules_install
   cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.12
   cp System.map /boot/System.map-2.6.12
   vi /etc/lilo.conf
         #stanza for image from lilo.conf
         image=/boot/vmlinuz-2.6.12
             label=2.6.12
             read-only
   lilo