Linux (Redhat 7.2) on Dell Latitude L400

by: Yoonsuck Choe

I recently got a Dell Latitude L400, with windows 2000 (win2k) preinstalled by dell. My main production machines are all running Linux, so I decided to install Linux on this new machine.

Here's what I got:

There were several issues that made this install different from my previous Linux installation experience, both on desktops and laptops. (I will assume that you are pretty familiar with most of the usual Linux installation procedure - defrag, splitting the partition, installing, installing LILO, etc.)

  1. Installing LILO on the MBR would cause problems - recall that this one had win2k.
  2. Cannot use floppy and cdrom concurrently (both are only available as external units).
  3. Besides these issues, disk defragmenter in windows 2000 was not able to move certain blocks toward the front, thus making the largest unoccipied space to be only about 8GB out of 30GB (this is what FIPS20 reports).
I will describe in the following how I got over these problems to get both Redhat Linux 7.2 and windows 2000 to coexist on my L400 without having to boot from the floppy.

1. Splitting the partition

I tried defragmenting in windows 2000 and then using FIPS, but defragmenting left behind odd blocks over the 20GB mark, so it left me with only about 8GB of space to install Linux, which was unacceptable. I was looking around for clues and found this page by Stephen Cornell, where he mentiioned GNU Parted, which is a tool similar to FIPS, but much powerful as it turns out. Actually, Stephen mentions that the hidden SAVE2DISK.bin file should be removed, but I missed that whole thing (probably this file was the cause of the abnormally large defragged partition detected by FIPS).

Anyway, I downloaded GNU parted, and installed it and ran it. Basically it amounted to downloading a bootable image, creating a bootable floppy with it and running parted (the bootable image contains a mini version of Linux). You'll have to look around a bit for the file: run find parted and you can get the path to the command.

GNU parted is able to resize partitions without damaging the data even when they are not defragmented, so I just reduced the win2k partition down to slightly below 1024 cylinders, which left me with about 8GB of win2k partition. The command-line interface was pretty straight-forward, so use the help to figure out how to reduce the partition. It takes some time to complete the resizing process, so be patient, and monitor the harddisk light - do not forcefully terminate the process!

Once the win2k partition was reduced, now I was ready to install Linux.

2. Installing Redhat 7.2 (focusing on LILO)

After setting the boot order in the BIOS to cdrom, floppy, hdd, I tossed in my Redhat 7.2 CD and booted the machine. Now I had to decide where to put LILO. I looked at several different L400 pages at Ken Harker's Linux on Laptops page, but couldn't find one with experience on installing LILO on win2k.

I found out a page at littlewhitedog, which describes how to make linux and win2k dual bootable. Basically, the page describes how to obtain the linux boot sector and setup C:\BOOT.INI in win2k to allow win2k boot loader to load linux. This is done in three steps:

  1. when installing LILO, install it on the Linux root partition, not on the MBR.
  2. from Linux, obtain the first 512k block of the root (the boot sector) using dd.
  3. copy that file to win2k and setup C:\BOOT.INI.
The first step is easy; just select the root partition when it comes to installing LILO during the installation process. The second and the third part needs some elaboration.

2.1 Obtaining the linux boot sector

Recall that L400 can only have either the external floppy or the cdrom attached to it. So, basically, you will have to reboot the machine. However, because LILO was not installed on the MBR, you can only get into win2k. To gain access to your freshly installed linux, you'll have to boot with the redhat CD and go into rescue mode. From the boot screen, start up in rescue mode.

This will drop you into a shell. All of your partitions will show up when you do df, and you will see your win2k partition among them if you selected the mount points appropriately during the installation process. I designated /mnt/win2k as the mount point, so I it was already mounted, and I was able to read and write from there.

To obtain the boot sector, you have to use the dd command. Following the instruction from the littlewhitedog page, I was able to save my boot sector on my windows C:\LINUX.BIN. Note: you have to replace the bold part below according to your local setup:

	dd if=/dev/hda5 bs=512 count=1 of=/mnt/win2k/linux.bin
Basically, this command takes the first 512Kbyte block from /dev/hda5 (my linux root where LILO was installed during RedHat installation) and saves it in the file /mnt/win2k/linux.bin.

Once the boot sector was copied to win2k, reboot into win2k.

2.2 Setting up C:\BOOT.INI in win2k

Basically, the instruction at littlewhitedog boils down to updating the C:\BOOT.INI file to look like below:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft windows 2000 professional" /fastdetect
c:\linux.bin="Redhat 7.2"
However, my win2k install did not have this file to begin with, and just creating this file did not make any boot option to appear when I rebooted. I looked around a bit for some more clue, and found out about this program called bootpart. The web page explains what bootpart is for:
BootPart is an easy tool for adding one partition in the Windows NT multi boot menu.
So, I downloaded the zip archive (bootpa22.zip), unzipped it and ran it. First you have to determine the partition number of your linux root by running:
	bootpart 			<--lists partitions
	bootpart /?			<--shows help

Beware that here the partition numbering starts from 0, instead of 1, so /dev/hda5 will have the partition number 4 under bootpart. The syntax of bootpart is:

	bootpart partition-number boot-sector-file "name-of-os"
So, in my case, with /dev/hda5 as linux root and C:\LINUX.BIN as the boot sector, I executed the following, which resulted in the C:\BOOT.INI file almost idential to the one up there.
	bootpart 4 c:\linux.bin "Redhat Linux 7.2"

Now with this in place, I rebooted, and finally win2k boot loader screen came up, listing win2k and linux. I selected linux from there, and it brought me to the familiar LILO screen. From there, I selected linux, and finally Linux was up and running.

Since I had the option of booting into win2k from LILO, I tried selecting win2k from LILO, but that brought me back to win2k boot loader screen, so that option in LILO seems to be unnecessary.

The rest of the installation and configuration part went painlessly. X11 and sound, apm worked out of the box with a stock Rehat 7.2 install. I haven't tried the suspend-to-disk feature yet. For more information on these stuff, visit Stephen Cornell's L400 page.

3. Conclusion

In this short blurb, I described how to make linux to multiboot with win2k on a Dell Latitude L400 notebook. I know that there is an alternate linux loader called grub, and it just might have made the whole process even less painful, but I don't know if grub is able to write linux's boot sector on win2k MBR without disturbing the win2k part. This would be worth investigating. If you were able to use grub to get around the steps described above, please let me know. YC


Last Modified: Sat Feb 16 23:23:57 CST 2002

Nothing beyond this point.







































.