Dual Booting Linux and Windows XP.
Jan 12,2006
If anything can go wrong, it will.
Notice that these notes are very old. It is much easier now that Ubuntu has been upgraded and supports all of this hardware, and XP now has built in options to write to a CD-ROM.
This document describes the following:
I always like to use free versions rather than trial versions, so
whenever possible that is what I did. In most cases I used Google
to search the internet.
System
The system is an HP a1250n, which has the following.
Athlon64 x2 processor
Motherboard: MSI MS-7184, Socket 939, Northbridge ATI RS482,
Southbridge ATI SB400, HP name: AmethystM or AmethystM-GL6E
250GB SATA drive
ATI Radeon Xpress 200 Series integrated video
Windows explorer disk usage shows:
9.68 GB used on C:
8 GB Recovery partition
System Backup
Followed the instructions from the "PC Troubleshooting Guide" and
the section called "Creating System Recovery Disks". Created two
DVD's, and one CD-rom. This will not make a backup of data files, but
will allow restoring all system files back to the initial purchase state,
except that it will not repartition.
Download Ubuntu
I decided to use the Ubuntu Linux distribution. I don't have any
strong reason for doing this other than it looks like a popular
distribution for a desktop system. Downloaded Ubuntu from
www.ubuntulinux.org.
This takes many hours even with DSL. I got the Ubuntu 5.10 version.
Burn to CD
Downloading provides an ISO image. Software is needed to
write the ISO to CD-Rom. I tried Sonic RecordNow!, and found
that the Data Disc choice is not correct, and don't know which
setting is correct. Maybe Exact Copy?
So instead I tried downloading some tools from the web.
First I tried Alcohol120% (a trial version), but this program only
partly installed and then crashed during the install. I tried
installing again, and it said some drivers were already installed,
so it couldn't be installed again. There didn't appear to be an
uninstaller either.
I started to download Nero, but it would have taken too long since the install
is so large.
So instead I searched using Google for "ISO CD Rom" and found a Wikipedia
article with a link referring to free burning from Windows. This link
ponted to the free Iso Recorder version 2 from
isorecorder.alexfeinman.com/isorecorder.htm.
The surprising thing is that after downloading, the installer indicated that
the Alcohol120% drivers were already installed, and asked if they should be
cleaned up. Pressing Yes, cleaned up the Alcohol120% installation! After
the Iso Recorder is installed, right clicking on the iso file in the explorer
will display a menu item to "Copy an image to CD".
This program worked, but I didn't change the default speed (40x) under
the Properties button, which caused some trouble as described later.
Repartition
Repartitioning can easily erase all of your Windows data. Therefore, you should
save everything and make backup disks as described in the system backup above.
Even then it may not be entirely safe, so find someone that knows how to do this
to help. I used a guide at
users.bigpond.net.au/hermanzone/p3.htm to get a feel for what it would be like.
It did not describe what to do in case of a failed CD-Rom install or other problems
that could occur.
A Linux distribution requires a separate disk partition from the Windows partition.
In addition, the NTFS Windows partition was taking the full disk size, so making
a new parition requires resizing the Windows partition so that it is smaller.
Most Linux distributions will repartition and resize partitions as part of the
installation. The original partitioning was as follows.
8.6 GB Windows restore partition
241.4 GB NTFS Windows partition
8.2 MB Free (Note MB, not GB.)
I inserted the CD-Rom and booted the Ubuntu. This loaded all drivers correctly,
and brought up the disk partition screen. I tried to manually partition, so
that I could get the following:
8 GB Windows restore partition
120 GB NTFS Windows partition
32 GB Fat32 exchange partition
Remaining Linux Ext3 partition
Linux swap partition
I was thinking that I need a partition to exchange files between Windows and
Linux, and I read that a Fat32 partition can only be 32 GB. Otherwise I would
have made this exchange partition larger. Then I read that there is a tool called
explore2fs that can read a Linux partition from windows. So I decided later
to simply create the following.
8 GB Windows restore partition
120 GB NTFS Windows partition
Remaining Linux Ext3 partition
Linux swap partition
This allows simply performing the first partition option to resize the disk, and use
the remaining for Linux. If I find later that explore2fs or some other tool doesn't
work well, then I will resize the Linux partition, and add a new Fat32 partition.
Resizing the NTFS Windows Partition
I tried the option to "Resize SCSI1(0,0,0), partition 2(sda) and use freed space)",
but it gave the error, "Failed to create enough space for installation".
I tried defragmenting the Windows disk, but this didn't work. Some newsgroup
said something about unmoveable blocks, but somebody else responsed that the resizer
was fixed to handle this long ago. There were other notes about turning off
Windows virtual memory and system restore, but these options didn't help either.
I tried the different Ubuntu boot options, noapic, acpi=off, pci=noacpi, and these
all hung the PC while loading drivers.
I found a note that described how to resize NTFS for a dual boot Windows system,
and it indicated that the Knoppix live CD had a newer version of Ntfsresize than
was in Ubuntu and would resize. I downloaded Knoppix at
www.knoppix.org.
Knoppix booted great and running
the partitioning is easy. I found the notes at "Ntfsresize Frequently Asked Questions"
at
mlf.linux.rulez.org/mlf/ezaz/ntfsresize.html.
Boot from the media and hit when you see the message "Boot:".
Click the "K" menu in the bottom left corner.
Click the "System" menu.
Click the "QTParted" which is a graphical, user friendly partition editor.
But trying to repartition gave the error "Filesystem check failed, Totally 1 cluster accounting mismatches."
Then I found that in Windows, chkdsk fixed the problem. Just run Start/All Programs/
Accessories/Command Prompt, or Start/Run and enter command.exe. Then run
chkdsk /f. You have to reboot into Windows, and after this, the Ubuntu resizer worked fine.
If the boot of Ubuntu gives the error "no root filesystem", edit the desired partition and
fill "Mount Point" to "/ - The root file system".
Corrupted Windows
Somehow I made a mistake during the manual partition, and did something to partition
two which is the Windows partition. This destroyed my Windows installation.
I was able to boot and pressed F10 to perform a recovery from the recovery
partition on the hard disk. The normal restore didn't work, but the destructive
restore worked very well. It also didn't change any of the partitioning, so I
still had the Linux partition.
Install Linux
So now we are partitioned, and ready to install Linux. I tried to boot off of
the Ubuntu CD-Rom, got the partitioning correct, and the step,
"Installing the base system" started. It got 6% in and then the error,
"Base system installation error" appeared and said,
"Check target/var/log/bootstrap.log". I used Knoppix and looked at var/log, and
it showed the directory was empty.
I found that booting the Ubuntu CD-Rom, then pressing pressing Back or Esc key
would display a menu. On the menu, there is an option to Check CDRom. This
showed that the CDRom was defective a few percent in.
I found out that the Ubuntu CD-Rom created with Iso Recorder was defective. I
was using a CD-Rom rated for 32X, and the default Iso Recorder setting is 40x.
I tried downloading ISOBuster and MD5Summer, but I couldn't get MD5Summer to
work on an entire ISO image. I also couldn't figure out how to use ISOBuster
to split the image into something MD5Summer could check. There may be other
programs, but I just decided to move on without checking the downloaded ISO image.
So I changed ISO Recorder Properties to 10x, and tried again. Each time an
install fails, the disk partitioning must be run again. Use Manual Partition,
and reset the Linux partition to:
Format the partition: yes
Mount point: / - The root file system
Bootable flag: on
This time it got through more files during
the base install, but it spent about one hour at the 6% mark. Then I ran
Check CDRom again, and it got about 50% through.
Then I tried Iso Recorder at 4x.
This time I ran Check CDRom before installing, and it showed the CD as 100% ok.
It got through the base install very quickly and successfully since the CD was
not retrying with errors. Then I let the boot loader overwrite the disk by
answering yes to, "Install grub to master boot record." I pressed Yes to
accept the defaults on the display options screen. Make sure to remember your
user name and password.
Changing Boot Menu Order
The default installer makes a boot loader menu that is too inconvenient to
access Windows XP. I also found that upgrading the Linux kernel can actually
remove the windows selection if there are many menu choices, although it does
save a backup copy. It is possible to make both Os's unbootable by modifying
the boot files. To restore them, you may have to boot a bootable OS like the
Knoppix live CD in order to change the files back to some previous configuration.
Make a backup copy of menu.lst. Then you can edit the boot/grub/menu.lst file
by staying in the Ubuntu windows, and choosing the Places menu, then select Desktop.
This will bring up the file explorer. Navigate to the menu.lst file and double
click on it to edit it.
It is also possible to use the recovery boot option and run nano as follows.
cd /boot/grub
cp menu.lst menu.bak
sudo nano grub/menu.lst
The the Control K, Control U keys can be used to move single lines at a time.
I only moved the section:
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title Windows XP Media Center Edition
root (hd0,1)
savedefault
makeactive
chainloader +1
to the position after:
## ## End Default Options ##
This makes the Windows partition first, followed by the Linux partition. This means
that the two most popular selections will be the first two menu items. I also
renamed the Windows NT partition to the Windows Recovery partition. The paritioner
must have removed the original name.
If you make a mistake, boot the Ubuntu recovery boot menu item. Then use
cd /boot/grub
cp menu.bak menu.lst
Configure Linux
Then I rebooted off of Ubuntu Linux on the hard drive and was it successful?
Yeah, right.
Display Problems
After the system boots, the display flickers a few times, and an error displays
and a prompt for saying that there is an X Server problem. Scrolling down shows
two errors. One is DRIScreenInitFailed, indicating that DRI will be disabled,
and the other is XAAInit. After that, the display shows a command line system
for logging in. If you want to jump to a non-ideal but very simple, workable solution,
skip to the Acceptable Video Solution section.
If you would like to do something a bit more complex, then continue to
read on.
I expect that the next version of Ubuntu will fix all of this in Aprix of 2006.
I am also not playing video games with high requirements, and when I make a PVR,
I don't plan to use the built in video much, although this may change.
Video Configuration
The ATI Radeon Xpress 200 has a maximum resolution of 1280x1024, and the
maximum refresh rate is 85 Hz. I have an old Sony 200sf, which searching the
internet revealed has a 30-80Khz horizontal frequency, a 50-120 Hz vertical
refresh rate, and maximum resolutions of 1600x1200 @ 60 Hz, or 1280x1024 @ 75
Hz.
The Ubuntu 5.10 is named Breezy. An older version of Ubuntu is named Hoary.
The 8.16.20 drivers are shipped with Breezy. The new drivers that are used
here are the 8.20.8 drivers.
Unix/Linux Commands
Some simple commands that can be used at the command line are shown below.
This section is just to help remember what command line commands there are,
and pointers to search for more help, and to help understand some of the
commands you may see.
Command
Description
man
get help on any command, try "man ls"
ls
view directory files and subdirectories
cp
copy files
mv
move files
rm
delete files
rmdir
remove directory
mkdir
create directory
find -name
can be used to find a file
cat
can type files
nano
a simple text editor
sudo
"super user do" rights
startx
start the windowing system
grep
search for text in a file or find files with certain text,
use -i to ignore case
|>
pipes and redirection for stringing commands together
more
a filter to present page views. Use like "ls * | more" in
directories with many files
glxinfo
graphics information
fglrxinfo
ATI graphics information
Video Fix Attempts
I tried many different solutions on the web. Many of them do not work with
the Athlon 64 or the ATI 200 Xpress. At this time, the
wiki.ubuntu.com/BinaryDriverHowto/ATI does not work. I ran these
and they messed up my system. I had to run the Synaptic package manager from
within Ubuntu to clean them up.
I also tried many settings, including resolutions, video memory sizes,
kernel framebuffer settings by using
sudo nano etc/X11/xorg.conf
I also read a lot about PCI Xpress support, kernel configuration bus options,
ways to turn off AGP, etc. but these all require recompilation of the kernel.
Video Solution
Before running these steps, install the SMP kernel as shown here
Symmetric Multi Processing.
I did the steps out of order, and had to run them twice.
The solution was found on an unofficial wiki at
wiki.cchtml.com/index.php/Ubuntu_Installation_Guide, although
this internet guide is not written for the AMD 64. I have modified the
important parts and shown it here.
For the standard HP hardware, the following is ok. If you have
additional hardware, read warnings from above link about the fact that
running the following will remove support for some hardware.
Running the following will overwrite the /boot/grub/menu.lst file.
Therefore it is best to back it up using
cd /boot/grub
sudo cp menu.lst menu.bak
The sudo command gives "super user do" rights to the commands. Sudo bash
does it for all commands following. At times, it may ask for a password,
so just use the password that you entered during the install.
Remove Breezy's included drivers if they are installed:
Reboot.
The results of booting show up in the var/logs/Xorg.0.log file.
Download the ATI driver installer at
support.ati.com.
This link can be found under
http://www.ati.com/support/driver.html.
Select drivers for Linux x86_64, and then "Motherboard with ATI graphics".
Create a download directory. You can either use Create Folder inside of Ubuntu
or mkdir in the command shell. Change to the download directory. Make sure that
you have the universe and multiverse repositories enabled before doing these steps.
Get the build tools and ATI files.
The first time I did the install, the older AMD files were released. Skip
this and use the newer section below.
The second time I did the install, these newer AMD files were released.
I deleted all ATI files and directories in /usr/etc and reran the package
manager to update versions from inside the Ubuntu windows environment.
If the version number of the downloaded drivers changes in the future, download
the driver, and after running the "sh" command, use "list" to see what .deb
files are produced. Then run dpkg on these files.
If you reboot or use startx at this time, you may get an error, "libGl error:
drmMap of sarea failed". To fix this, get a new libdri.a file as
documented in a few posts.
You may get an error, "Duplicate symbol, rol_long". To fix this,
comment out the Load "int10" line in the /etc/X11/xorg.conf file by
nano and entering the following on the line.
# Load "int10"
The last time I installed the ATI package, I had to change the driver
from "ati" to "fglrx" in the /etc/X11/xorg.conf file.
Reboot or use startx and confirm that it worked
fglrxinfo
display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: RADEON XPRESS 200 Series SW TCL Generic
OpenGL version string: 1.3.5519 (X4.3.0-8.20.8)
I got slower rates than shown below when using the SMP inside of the Ubuntu
window environment. It could be that some window parameters had changed.
glxgears -iacknowledgethatthistoolisnotabenchmark
6122 frames in 5.0 seconds = 1224.335 FPS
6481 frames in 5.0 seconds = 1296.102 FPS
6480 frames in 5.0 seconds = 1295.965 FPS
Acceptable Video Solution
Edit the video configuration using:
sudo nano etc/X11/xorg.conf
Use arrow or paging keys to find Section "Device". Change the line
Driver "ati"
to:
Driver "vesa"
Then press Ctrl-X to exit, which will prompt for the file name. Just press Enter.
Symmetric Multi Processing (SMP)
The default Ubuntu install does not enable the dual core processor of the
AMD64 X2. To enable this, use the Synaptic package manager and download
linux-amd64-k8-smp. This will overwrite the /boot/grub/menu.lst file, so back
it up first.
To view the CPU status in Ubuntu, select Applications/System Tools/System Monitor.
Select the Resources tab, and there should be both a CPU1 and CPU2 listed for
the CPU history graph.
Playing Music
To rip a CD, insert the audio CD and a ripper will load automatically. This
will create .ogg files which is a free format.
When opening a music file, the error "Totem could not start up". "The
video output is in use by another application", is displayed. When starting this from
a terminal, the message, "(totem:9766): Gtk-CRITICAL **:
gtk_accel_label_set_accel_closure: assertion
`gtk _accel_group_from_accel_closure (accel_closure) != NULL' failed", was
displayed.
For music files, there is another player already installed on Ubuntu that
is accessible by right clicking on the music file. This player allows
selecting and playing many songs easy.
To get Totem to work, on the Ubuntu menu, run System/Preferences/Multimedia Selector, and on
the Video Tab, there are selections for Default Sink. Changing this to
"XWindows (No Xv)", allowed the Test button to work correctly, and also
gets Totem to work.
Copying files between the Linux and Windows XP NTFS partitions
In Windows XP, I downloaded the explore2fs program from
http://uranus.it.swin.edu.au/~jn/linux/explore2fs.htm. This program works
great to read files from the Linux partition.
To be able to read the Windows NTFS partition from Linux do the following.
In Ubuntu Linux windows, edit the etc/fstab file. Start an editor by selecting the
Places menu and selecting Desktop. Then click the square in the top left corner
that has a $lt in it. Then click to show the contents. Click on etc, then click
scroll down past the directories and click on fstab.
Put a comment character "#" before the existing dev/sda1 line, and add a new line
as follows.