Installing Windows XP, GNU/Linux, (trying FreeBSD with no luck) on a Toshiba M60-176 laptop


Linux On Laptops


Overview

The goal is to install following operating systems :

on a Toshiba Satellite M60-176 laptop (PSM60E-02D02NFR model).

The boot loader GRUB will be used to select the operating system to run, and it will be installed in the Master Boot Record (MBR) of the first (and only) hard disk.


[Back to the table of contents]



Preparing Windows to live with other fancy OS

Starting situation

The laptop comes with Windows XP Home already installed, with only one HPFS/NTFS partition spreading over the whole 100 GB disk. We suppose you did not change anything significant under Windows, and that you did not put it on the Internet yet, so that we do not start with any trojan/virus/spyware or weird environment.

First measure would be to make a back-up copy of the Toshiba recovery DVD, in case of problem. You can use the Sonic RecordNow! burner tool, which is already installed.

Then system informations should be retrieved from Windows. We have a translated version of XP, but you should find the program under System tools. Choose File->Save (not Export) into a *.NFO. This file is encoded in Unicode, the notepad can convert it to UTF-8, however we had to use OpenOffice and make some editing to obtain these system informations. Once stored in a file, any removable medium such as an USB key can be used to save them.

Planning the partition scheme

Instead of the unique Windows NTFS partition, the hard drive will have to be split in several partitions for all operating systems to be used. The first Windows partition will have to be shrunk so that it leaves room for the others.

We choose the following partition scheme :

There are still 16 GB which are not allocated, they will be available for later use (NetBSD install if GRUB is able to make it believe it is on a primary partition).

FreeBSD seems to be able to be self-contained in an unique partition (they call it slice), which it can logically split into sub-partitions (they call them partitions [!]).

ReiserFS will not be used since it is not recommended for laptops : it uses the hard disk permanently, which consumes much energy .

Shrinking the NTFS partition

Various approaches can be chosen for this task, one of the safest is to use ntfsresize, version 1.11.2 or higher. This tool can be easily obtained thanks to various Linux distributions. We first tried Knoppix version 4.0.2, but despite correct boot ordering, we never managed to boot to have our laptop boot on it. Maybe the image file was corrupted while transferred or burnt.

We thus used Linux RIP, for (R)ecovery (I)s (P)ossible. We burnt a bootable CD ISO (RIP-14.8.grub.iso.bin).

Shrinking the NTFS filesystem with RIP

Before shutting down Windows, one should defragment the hard disk thanks to the corresponding system tool, to ease the later partition resizing work. All valuable data pieces should be saved anywhere else than in this hard disk, since hazardous operations will have to take place. Then Windows should be halted normally, so that the journalized filesystem is clean on exit.

At the boot, ensure that the CD/DVD while be tried before the hard disk (permanently thanks to the F2 key or ponctually thanks to the F12 key), so that RIP is booted. Login as root (no password needed). Now it is time to shrink the first partition, which happened to be known from RIP as /dev/sda1 instead of /dev/hda1, apparently since it is a SATA disk (not IDE).

The following command will be used to simulate (read-only) this partition to 20GB:

ntfsresize -n --size 20G /dev/sda1

If the result seems correct to you, then hold your breath and issue the actual command (no -n this time) :

ntfsresize --size 20G /dev/sda1

Resizing the first partition

Having a shrunk filesystem is not enough, since the Windows partition is still occupying the whole disk. The solution is to use fdisk, to delete the previous partition and to create a new one at the beginning of the disk, large enough to contain the NTFS filesystem. Yes, deleting the partition and re-creating a smaller one is the only way, and it should not erase its content if done appropriately.

So a fdisk /dev/sda must be executed, the previous partition entry should be viewed and remembered so that, after its deletion, a new one can be created, i.e. with the bootable flag and the partition type 7, for HPFS/NTFS.

What new size should be used ? Obviously, less than the whole disk, more than the NTFS filesystem it will contain. As the target size was 20 GB and there were 12137 sectors, we thought that having this partition ranging from sector #1 (first primary partition for Windows) to 12 137 * 20 /100 = 2427 with a margin of 80 MB (roughly 10 sectors) would be enough.

However, as with fdisk one can enter the desired size, we entered 20 GB (as 20*1024= 20480, i.e. +20480M) and fdisk answered sector #2491. As it was far higher than our first guess (2437, margin included), we chickened out and chose #2500.

It worked, which means that after having written this new partition table (one entry, NTFS bootable from sector #1 to #2500), we rebooted to Windows (F12), a NTFS check had been triggered by ntfsresize and everything worked.

We may have chosen a too high partition size, resulting to some megabytes being spoiled, but at least it worked. Under Ubuntu, we can see that this the total size of this partition is 19.15 GiB, with 7.71 GiB of it being free. Maybe we lost about 7 GiB, maybe not if the NTFS filesystem can grow.

Hardening Windows

Before even accessing the Net from the amazingly still working Windows XP, some measures should be taken to protect it, since it is rather defenseless when taken from scratch, even behing a somewhat paranoïd Linux gateway. All binaries were downloaded from a Linux box and transferred to the XP box thanks to a removable medium. All these tools are free, as in free beer.

Adding an antivirus

We chose AVG Free Edition. Another good free antivirus may be avast! Home Edition.

Adding a decent firewall

Let Internet Connection Firewall (ICF, the Microsoft Windows XP - both Home and Professional editions built-in firewall) deactivated as it was, it would be safer for everyone, and use instead ZoneAlarm, which is user-friendly, reliable and able to monitor outbound connections as well.

Adding an anti-spyware

We use Ad Aware, from Lavasoft.

Adding a good and safe browser

Firefox will do the trick. Let it be your default browser.

Once all these products are installed, after they tried to make your laptop reboot a zillion times, note that they all use deprecated databases. Therefore the first step when online will be to update them all, starting from the system itself (Windows Update).

Securizing more

Courageous geeks would follow these two guides [1, 2] if they had enough time.

Now you have a well-behaving Windows XP installed, and ready to live next other operating systems.


[Back to the table of contents]



Installing GNU/Linux Ubuntu 5.10 (Breezy Badger)

Getting the install CD

Just go to Ubuntu download section, pick the correct ISO image (we used ubuntu-5.10-install-i386.iso, install, not live).

If, like me, you had the worst troubles with the not-so-reliable xcdroast and k3b, just burn your CD directly with your laptop, from Windows. However the pre-installed Sonic RecordNow! should be avoided, because this quite limited tool seems unable to burn an ISO image : when downloading such a file from the Internet, it automatically suggests to burn it...and creates a data CD with a Joliet filesystem with one file in it...the ISO image...no comment.

One shall use CDBurnerXP Pro instead, which is a free (as in free beer) tool that behaves nicely [more infos]

Grabbing some useful informations

Altough we did not need these informations, we stored them after our successful installation, to help poor lonesome geeks encountering Linux issues.

One can find a slightly edited version of the following files :

Correcting the installation process

Having fun with Xorg

You can smoothly follow the installation process, that we found very well designed and user-friendly. However when the great moment came, the configuration of Xorg, we chose the correct screen definitions (1440*900 and 1280*800 which both have the best ratio for the LCD screen, 1.6, and a few standard ones such as 1024*768), blam... a black screen and nothing more except some weird sounds. The text consoles were still available though (CTRL-ALT-F1 for example), which allows to log as root (log in as your pre-declared first user and then enter sudo bash and enter your user's password to gain root priviledges).

After some efforts and web inquiries, it was clear that gdm was failing constantly because of a No screens found which was due to a misconfiguration of the video chip. In a nutshell, here is my correctly working xorg.conf, which uses indeed the ati driver (not the VESA one). The relevant section that had to be changed is this one :

Section "Device"
	Identifier	"ATI Technologies, Inc. Radeon Mobility X700 (RV410)"
	Driver		"ati"
	BusID		"PCI:1:0:0"
	Option 		"BusType"   	"PCIE"
	Option 		"CRT2Position" 	"clone"
	Option 		"MonitorLayout" "LVDS,CRT"
EndSection

Having fun with a Gnome

On reboot my X session lasted for less than one second, and failed afterwards with a splendid unable to read ICE authority file. It may be linked with the fact that my LAPTOP was getting its network settings from DHCP, or more probably with the Xorg experiments I had to do under root.

Looking at ~/xsession-errors, it appears that ~/.ICEauthority is owned by root:root instead of sam:sam, if your first user name is sam. To correct that, use :

sudo chown sam:sam /home/sam/.ICEauthority
and your problems should vanish.

Final point

Apart some minor changes (domain name) and customizations (all through the GUI), nothing more had to be done. It has been one of the less painful GNU/LINUX installation we have ever known, whereas it took place on a brand new laptop. Thanks to the automatically well configured GRUB, Windows XP was still perfectly working afterwards. Thus the result is pretty encouraging. Kudos to the Debian and Ubuntu community, which gave us a really nifty operating system indeed.

Post-install : preparing for FreeBSD

No need to create special partitions, since the FreeBSD install process will take care of that. Instead, GRUB should be configured so that it can launch the future FreeBSD system as well.

To do so, one just has to edit /boot/grub/menu.lst and add at the end :

title FreeBSD 6.0
root (hd0,2,a)
kernel /boot/loader

This should mean : the FreeBSD system can be loaded from first disk (hd0), third (primary) partition (FreeBSD slice 2, since it starts from zero), in sub-partition (FreeBSD partition) a, kernel being found in /boot/loader.

Note that GRUB must be in version 0.95 or later to be able to read UFS2 partitions.


[Back to the table of contents]



Unsuccessful attempt of installing FreeBSD

The whole installation process went well until first reboot, during which FreeBSD hangs. More details on it at the end of section.

Preparing the installation

One should read beforehand the FreeBSD Handbook [french translation], at least a bit, even if some sections are obsolete (ex : the deadly conflict-free kernel configuration).

Choosing a sub-partition scheme

With FreeBSD, usual partitions are called slices. Partitions can be used internally by FreeBSD as if it was a set of sub-partitions, they called them, well, partitions. We will stick now to their naming conventions.

We saw, when we first divided the hard disk into separate spaces for the operating systems, that the third primary partition of 15 GB was devoted to FreeBSD. Now it is time to split this slice into FreeBSD partitions :

Getting the installation CD

For the 6.0 version one can go directly to the FreeBSD release page, choose its preferred transfer method (ex : bittorrent) and the appropriate ISO image (ex : 6.0-RELEASE-i386-disc1). This disc 1 will be enough to bootstrap a complete FreeBSD installation. Check the MD5 sum of the downloaded image if necessary, burn it on a CD-R, reboot your computer on this CD, and follow the instructions.

Installing FreeBSD

Beware, innocent creature ! Prepare to enter in a error-prone installation system where most key mistakes will lead to re-starting from scratch.

Using CTRL-ALT-DEL or any cancel/undo feature to avoid the full reboot is NOT an option (despite what the manual claims) since it often leaves the installation program in a faulty state.

As for us, our first tries led to using the restart feature, which resulted in zillions of errors such as /create/symlink failed: no inodes free just after that the so-called emergency holographic shell was launched.

Apparently this occurs after a abort/restart installation process, which then tries to install everything...on the ramdisk instead of on the hard disk !

Under sysinstall, French users should select the French ISO keymap with accent. It is time to select Begin a Standard Installation.

Messing with slices

Under the FDISK-style interface, after the frightening warning about incorrect drive geometry, pressing G should automatically correct the problem without you having to type in the numerical values. It was the notorious "geometry bug" which has plagued FreeBSD for a long time.

Then hit the Z key until the slice sizes are expressed in GB : it will give you a chance of choosing carefully the right slice where to install FreeBSD. The filesystem types seem to be incorrectly detected (ext2 instead of ext3), a funny small unexpected slice was detected at the beginning of the disk, sizes are never exactly the same depending on the tool being used, but the targeted slice was to be found in ad0s3 in our case.

We had to change the type of this slice from ext2 (created as a side-effect of Ubuntu installation) to freebsd (press the down arrow until the slice is highlighted and then type t and choose code 165). We did not set the bootable flag of the FreeBSD slice to true, since GRUB is able to manage it. Doing so will avoid nasty problems with Windows XP detecting another bootable partition.

When finished, press Q and choose not to change the MBR : the already available GRUB will be the boot loader.

With no more disk whose partition table would have to be modified, it is Disklabel time : into the FreeBSD slice, let's create FreeBSD partitions. Pressing A allows to have a default partition scheme, which we found quite good and left as it was. Note that pressing U (for undo) will bring you back to...FDISK's beginning, not Disklabel's one.

Choosing what to install

We chose the most complete distribution set (All), as everything was interesting and there was presumably enough room on the slice for that. We chose the Port Collection as well, though the installation program does not check to see if you have adequate space.

Then the CD/DVD installation media was selected, we confirmed that real actions could be taken, and this time the ramdisk was not incorrectly chosen by the installer instead of the hard disk : with a non-interrupted installation process, there had been no more symlink/inode issues and the installation proceeded successfully to the end of the phase.

Post-installation started with the network device configuration. Firewire and the Ethernet card (Realtek) were detected, no Wi-fi available at this point though.

We selected the Ethernet interface, did not try IPv6 configuration, refused DHCP since we preferred having for this computer static network settings. After having entered these settings (desired IP, gateway, DNS server, etc.) the interface could be set to up. One can check it is successful by pinging this newly created interface. As this computer is expected to be a client, we did not activate the gateway features.

Then network services (inetd), anonymous FTP, NFS and were deactivated. only SSH login was kept. Console settings were a bit customized, time zone was entered (not UTC), linux compatibility was enabled. As for the mouse, we did not plugged anything, we chose Enable : Test and run the mouse daemon which happened to detect automatically the touchpad.

Afterwards the installation system jumped to the Install Packages screen section (2.9.14) instead of the Configure Additional Network Services section (2.9.11). It is because the compute will not act as a gateway, and the X server facility has been removed from sysinstall, probably because it was too often failing badly.

We chose the All category, but apparently each package had to be specifically selected. Quite a dull task indeed. After having acknowledged the package list, the actual installation was started. Many packages were to be found on disc 2, which we had not burnt, so we had each time to postpone the disc change.

Then a new user was added to the system, and the root password was set. The general configuration menu has been visited but not used, the sysinstall was exited, CD-ROM removed and the computer rebooted.

What never worked : the boot process

As stated very precisely here, after that bootstrap began, the FreeBSD text boot menu is displayed, with ASCII-art. No matter which of the eight entries is selected, none works, the system just hangs. For the default option (1. Boot FreeBSD [default]), this line is output :

/boot/kernel/acpi.ko/boot/kernel/acpi.ko text=0x40c2c data=0x2160+0x1090 [..]
and the spinning pipe (| then / then - then | then \ etc.) freezes.

Using the option without ACPI (2) or in safe mode (3) or with verbose logging (5) does not work either.

At the time of this writing (january 2006) we could not find any relevant solution on Internet. If ever you had a clue, please drop us a line !

On a side note, it should not be a GRUB problem since Ubuntu provides GRUB 4.95, which is the first to support UFS2. Besides, various GRUB configuration settings for FreeBSD have been tried with no luck, including some settings with rootnoverify/chainloader +1/makeactive etc.

It should be neither a kernel nor an ACPI problem since the CD-ROM can be booted successfully. What we finally came to believe is that the geometry of the 100 GB SATA TOSHIBA MK1032GA hard disk was not correct. More precisely, sysinstall detected geometry 193 433/16/63 it deemed incorrect, and set instead 12 137/255/63. Maybe this last geometry is wrong too, but we cannot try the one detected by the BIOS since it does not let the user know it. A search on the web did not return anything useful about it.

Finally, the hint of disabling the support for legacy USB from the BIOS did not work either.

Some interesting FreeBSD links

[Back to the table of contents]





Please react !

If you have information more detailed or more recent than those presented in this document, if you noticed errors, neglects or points insufficiently discussed, drop us a line!





[Top]

Last update : 2006, February 7, Tuesday