| Howto Install Windows XP and SuSE Linux on the same PC SuSE Linux and Windows XP, Dual Boot,Newbies Guide
For the past several years, Linux has become easier and easier to install
and use. The SuSE installer would partition your hard disk, shrink Windows
to make room for Linux and add a boot menu so you could choose Linux or
Windows. On the Mac, it was the same. Also the same in other Linux
distributions.
But, now in 2002, the available PC's have Windows XP with a new file system
(ntfs) that makes things much more difficult. The only easy route is to
discard Windows and let the Linux installer create a Linux-only
computer.
Skilled hackers know their way around all the obstacles, and much of this
has been posted here. But, abbreviated recipes won't be much help to
Newbies trying to do this for the first time.
The purpose of this article is to provide a guide, accessable even to
Newbies, for creating the desired Linux-plus-Windows installation.
-
What I wanted:
-
-
Nice Linux machine.
-
Easy to re-boot into Windows from time to time.
-
Able to save files in either Linux or Windows and then see
them from the other.
-
Easy to return the machine to it's original Windows-only
state.
- Limitations of this article:
-
-
I'm doing this in SuSE Linux ver 8.1; some of the problems I'm
solving may be handled by later versions of SuSE Linux or in
other Linux distributions. Caveat reader.
-
My approach is a second hard disk drive for Linux, so this
won't work for laptops. Some, not all, the comments below will be
relevant to laptops.
-
I'm working only with SuSE Linux. A similar approach will
probably work wtih other Linux distributions, but the details may
be different. Hackers, please comment
-
My primary desktop environment is Mac OS X, not Windows,
so I may be missing some obvious points about Windows.
-
My instructions assume you are using the graphic user interface
in Linux (KDE) and not the text-only approach sometimes used for
servers.
- Problems to solve:
-
-
Today's machines come with Windows XP. The XP file system is
ntfs (a more modern file system than FAT which was used up to
Win98). The Windows XP file system fills the whole disk, leaving
no room for Linux.
-
SuSE installer has a partition re-sizer to make room for
Linux, but it won't resize the ntfs file system, only the older
FAT file system. The only option in the SuSE installer is to
delete the Windows XP system. We don't want to do that! There is
no easy way to setup dual boot.
-
SuSE suggest the easiest approach is to delete the Windows XP
partition and create a new FAT file system for Windows, and then
resize that partition with the SuSE installer. Ugh! This creates
a new set of problems: Windows XP may not work as well with FAT.
You may not have installer CDs to install Windows XP in a FAT
file system. We want the Windows-aspect of our computer to be
100% standard.
-
SuSE Linux can see the Windows ntfs
partition and read from it, but cannot write files on the ntfs
file system. Windows deals only with Windows-stuff and can't even
see the Linux partition. The recommended
solution, if keeping the ntfs file system for Windows, is to
create a FAT32 partition that both OS's can read/write and use
this for files to be accessed from both sides.
All the above leads me to an easier approach: A second hard disk...
-
Win XP will only boot from first hard disk. (There are some
technical details here, but I believe the restriction is that
Windows will only boot from the first hard disk in boot-priority
order.)
-
Many PC vendors only provide a Restore
cd, not a complete Install cd for
Windows. Comments here on usenet suggest that if you resize the
Win partition, you cannot reinstall Win XP from these
Restore disks without going back to
scratch (that is, without resetting the whole hard disk drive to
be dedicated to Windows.) Again, Windows deals only with
Windows-stuff.
-
We want to make sure that a re-install of Windows won't wipe out
your Linux. In particular, that it not wipe out the nice
Choose your OS.. menu when booting. Using
the restore disk will probably overwrite the whole drive in
question, including the Master Boot Record (MBR)
where the Linux boot manager is located. Therefore, we don't want
to put the nice Linux boot-manager on the Windows drive. Instead,
we'll put it on a separate Linux hard disk drive. Also, for the
same reasons, we want the FAT32 partition to be on the Linux
drive. (Note: It's going to be harder on Laptops... Most laptops
have only one hard drive.)
- Assumptions:
-
-
You are using a new consumer PC.
-
It has Windows XP; I also think Apple is great, but this
article is NOT about installing on an Apple computer.
-
It has one ATA/IDE/EIDE-type hard disk drive
-
You can add a second hard disk drive
-
Your Windows XP and your SuSE Linux installations will be
standard
-
My approach to solving the problems:
-
-
Add a second hard disk drive for Linux
-
Make Linux the first drive, and
Windows the second
-
Add a FAT32 partition to the linux drive that both operating
systems can read/write. Format this partition as FAT32 in
Windows.
-
Configure the Linux boot loader (GRUB) to give you the choice of Windows
or Linux at boot time.
-
Learn to mount the FAT partition in Linux.
- Major alternatives to my approach:
-
-
instead of dual boot, create a Linux only machine. This is much
easier, the installer will take care of everything.
-
instead of a second hard drive, resize the Windows partition
and put everything on one drive
-
instead of configuring the boot loader, twiddle the bios to
change the boot priority order of the hard disks (see step 6
below)
-
instead of creating a shared partition, just email yourself any
document you want to use in the other operating system
- Basics you need to know:
-
-
Booting means loading the system software from the hard
drive. Booting takes place when you turn on or restart your
computer.
-
In Windows, your disk drives and partitions are listed as C:,
D:, E:, etc.
-
In Linux, your disk drives are hda, hdb, etc., where hda is the
"first" drive and hdb is the "second".
-
Each drive may be divided into partitions which work like
"virtual" disk drives.
-
In Windows, partitions appear as additional "Local Disk Drives"
E:, F:, etc.
-
In Linux, partitions are identified by adding a number to the
drive label. So, hda1 is the first partition on the first drive,
hda2 is the second partition on the first drive, etc.
-
It's crazy, but for historical reasons, the boot programs know
the drives as (hd0) and
(hd1), that is, zero is first, one is
second. Naturally! For the boot loader, the partitions are
indicated with a comma and digit, again counting up from 0. -- So
(hd1,0) is the second hard drive, first partition. -- Similarly,
(hd0,2) is the first hard drive, third partition. (Fortunately,
once you've set up your boot menu, you can forget about the
"start from zero" scheme for just about everything you'll want to
do.)
-
Within a partition, a file system has to be created before you
can do anything else. SuSE will take care of this for the Linux
partitions, and Windows handles it's drive. We'll use the Windows
format utility for the FAT32 partition.
-
For the main Linux partition, the filesystem is probably
ReiserFS, the SuSE default. But you could choose ext2 or
ext3.
-
It's confusing, but the label "FAT" is used for three slightly
different file systems: FAT, FAT16, and FAT32. We'll use FAT32,
the most modern of these because it allows long file names. Linux
sometimes uses "vfat"
for FAT32.
Procedure 1. Steps: -
Test your computer with Windows XP. Set up your Windows users, register
with Microsoft, etc.
-
Buy an additional hard drive. These are quite cheap now. You can have
40gb for a little over $100. I bought Maxtor Ultra Series 80gb (red
box) for $150. Six months from now, you'll laugh at these prices! I
think most any IDE/ATA drive will work fine.
-
Change the original hard drive from Master to
Slave by opening the case and moving a jumper on
the drive. Install the new hard drive, and set it to be
Master on the same IDE cable. Look for some
instructions with your new hard drive, make notes, and check your
original drive carefully. The jumper positions are different for
different brands of hard disk drive. Usually, there is something
printed on the drive label.
Tip
(You might want to get help to do the Master -
Slave changes and install the new drive.)
(It would probably work to put the original hard drive on the second
IDE cable as Master, where the new drive is Master on the first IDE
cable just as above, but I haven't tested this.)
Just remember, the original drive with Windows will be the second
drive, and the new one with Linux will be the first drive.
-
Install SuSE -- Run the SuSE installer, starting with SuSE's
directions. Usually this means booting from CD#1 or the DVD.
-
Throughout the installation -- Remember that you are installing
Linux on hda, the "first" drive. The SuSE installer should suggest
this as the default.
-
Create a partition to share between Linux and windows -- At the
partitioning step of the install, shrink the Linux partition a bit
and add a FAT partition on hda. For "mount point" of the FAT
partition enter /windows/share and the remaining
default options for "FAT" should be OK. Both Windows and Linux can
read and write to this FAT32 partition. I made my FAT partition
300mb. [Perhaps we could specify the options for
/etc/fstab at this point, but I did it later.
Comments?]
-
Rest of Installation -- Follow SuSE's suggestions to install on
first hard drive (hda). Follow SuSE's suggestions to install GRUB
on the Master Boot Record (MBR). On the software options page,
choose system. You're done when
you get the KDE desktop and not the installer menus.
-
Explore Linux a bit. There are a few more steps before we can
easily switch back and forth between Linux and Windows, but these
can wait.
-
Test booting -- Logout and restart your computer. Watch the boot menu.
You should get options for Linux, Floppy, and Failsafe. Also a couple
of "windows.." options. Check that "Linux" works. Don't try the
"Windows" choices in the boot menu; they won't work! Make a note of the
items you see in the boot menu. (I did try the "windows" option and the
computer "hangs". If this happens to you, the old "three finger salute"
still works... hold Ctrl and Alt while you type Delete. This will
restart your computer.)
-
(Strictly Optional) Switching OS's the HARD WAY -- You might need to
use this in order to boot Windows before completing the remaining
steps. It's awkward, but it does get you to Windows... When you boot,
there is probably an option to enter the "BIOS Setup". Watch for this
option and act quickly. On my machine, I have to hit "Del" within a
couple of seconds. Proceed carefully, but find the option to change the
"boot priority" of the different hard disks. You can choose Windows by
giving boot priority to the second hard disk drive, Linux by giving
boot priority to the first hard drive. This works, but there has to be
a better way!
If you do change the BIOS boot-priority order, then before doing the
remaining steps, go back and reset the boot-priority order so the first
hard disk (with Linux) has priority.
-
Fixing the Windows item in the Boot menu -- Restart your computer,
choose the default "Linux" in the boot menu, login as root. Note that
"root" will NOT be one of the choices you can select by clicking the
name/picture on the login menu, just type "root" in the "Login" space
and give the root password. You should see the KDE desktop. Notice the
warning icons on the desktop. As root, you can blow things up
completely! Be careful.
-
Check the boot options created by the installer. Launch
YaST2 by clicking the bottom-left icon,
the gear wheel... then ... then
; the name is an acronym for
"Yet another System Tool" and this is one of
SuSE's important contributions. -
Choose "" in the left panel of
YaST2.
-
Choose "" in the
right panel.
-
Choose "". Next.
-
Look at the window "Boot loader
configuration:"... After some initial items,
you'll find one section for each item in the boot menu. Each
sections starts with a "title" line. (The text in this window
is from the file /boot/grub/menu.lst )
Here's what SuSE's installer created for me:
---- START of /boot/grub/menu.lst ----
# Modified by YaST2. Last modification on Thu Nov 21 23:31:22 2002
gfxmenu (hd0,1)/boot/message
color white/blue black/light-gray
default 0
timeout 8
title linux
kernel (hd0,1)/boot/vmlinuz root=/dev/hda2 hdc=ide-scsi vga=785
initrd (hd0,1)/boot/initrd
title windows 1
root (hd0,2)
makeactive
chainloader +1
title windows 2
root (hd1,0)
makeactive
chainloader +1
title floppy
root (fd0)
chainloader +1
title failsafe
kernel (hd0,1)/boot/vmlinuz.shipped root=/dev/hda2 ide=nodma apm=off
acpi=off vga=normal nosmp maxcpus=0 disableapic 3
initrd (hd0,1)/boot/initrd.shipped
---- END of /boot/grub/menu.lst ----
OK, so what's the problem? There are two problems with what SuSE
creates: -
The "windows 1" section will try to boot from the sharing
partition (first hard disk, third partition, the FAT
partition... remember it's counting from zero). This
partition will have only some of my files, and not Windows
itself, so any boot from this partition will fail. (I suppose
SuSE thinks we MIGHT put some Windows version on this
paritition in the future. I think this boot menu option is
confusing, so I'll just remove it.)
-
The "windows 2" section is pointed to the right place, but
has an error.
-
Remove the wrong "windows" section -- Select the windows section
that references (hd0,2) by left-click-dragging over the text. Hit
the "delete" or "backspace" key on your keyboard to erase it. Poof!
Gone.
-
Fix the remaining Windows option -- Continue your editing... I took
the secton "windows 2" and changed it to be like this:
title Windows XP
map (hd1) (hd0)
root (hd1,0)
chainloader+1
makeactive
Note
Some notes:
"Windows XP" can be whatever text you want in the boot menu
"map..." see below.
Last two entries... I think SuSE has them in backwards order
Don't worry about the indenting... SuSE will fix it.
Ignore the button marked "Edit /etc/grub/conf"
-
Test the Boot Menu Choices -- In Linux, logout and select "Restart
computer". Try the boot options for Linux and Windows to verify that they
work. When you log-in to Linux, do so with your normal username, not as
root. Use root only when you need to in order to change a system
configuration.
-
Format the shared partition -- I use the Windows XP format command to
format the shared partition. -
Restart the computer
-
Chose Windows XP (or whatever label you chose)
-
Start... My computer... Your shared partition will appear as an
"extra" local drive. Mine was E:. Here's how to know you have the
right "local drive": When you click on a drive, it's icon is
highlighted and the lower left display shows the size and space
available. When you click on your shared drive, the lower left
display will not show size because the partition has not yet been
formatted.
-
Right click on your shared partition. Format. Choose FAT32, not
ntfs. Use the defaults for other options.
-
Now if you click on the shared partition, the lower left
display will show the size.
-
Make the "Shared" partition visible to Linux -
Restart, boot Linux, login as root, open a console window with
Konsole (I start Konsole with one of the icons in the lower
left... Move your mouse over the icons and let it pause. Linux
will show the name of the program represented by the
icon.)
-
Look as /etc/fstab this is the table that tells Linux which
partitions to mount at boot and which can be mounted by the user. In the
Konsole window, type
cat /etc/fstab
My output looked like this for the hard disks (there are additional
lines, but these are all the /dev/hd... lines)
/dev/hda2 / reiserfs defaults 1 1
/dev/hda3 /windows/share vfat defaults 0 0
/dev/hda1 swap swap pri=42 0 0
In this table, hda3 is our FAT partition for sharing between OS's.
(What's the problem? The problem is if /dev/hda3 is mounted with
defaults, this will be done by root at
boot-time, and no other users will be able to touch it. You won't
be able to touch it if you login with your normal userid, only if
you login as root. Instead, we need to set the shared partition to
be mounted by you after login.)
-
Save a copy of /etc/fstab
cp /etc/fstab /etc/fstabSAVE
If this fails, you probably didn't login as root. Logout, login as root,
and repeat from step 10.
-
Change /etc/fstab
umount /windows/share
pico /etc/fstab
This is a simple text editor. Use the arrow keys to move the cursor.
Ctrl-Dto delete a character. Just type to insert characters. Now change
the /dev/hda3 line so that instead of the word defaults", you have
noauto,user". When done, the first few lines of my /etc/fstab look like
this:
/dev/hda2 / reiserfs defaults 1 1
/dev/hda3 /windows/share vfat noauto,user 0 0
/dev/hda1 swap swap pri=42 0 0
... there's more... leave the additional lines unchanged ...
Note
(Thanks to Kevin Nathan for this tip.)
If you make a mistake,
Ctrl-X, No so you don't save, and repeat pico
/etc/fstab -
Still in Pico,
Ctrl-X, Yes to save, Return to confirm the file name.
Now you have changed /etc/fstab.
-
Logout, Shutdown, let the computer stop, then Power-on, and boot Linux.
-
If this doesn't work, boot rescue system and trouble-shoot.
-
Learning to mount your shared partition in Linux
To mount your partition:
-
Uninstall. Someday, you might want to return your machine to be a
Windows machine, just like you purchased at the store. I'm sure you'll
like SuSE Linux, but maybe you want to give the computer to someone who
doesn't know this yet! Remove your linux hard drive and change the
original drive (with Windows) back to "Master". Now, when you boot, the
machine will never know that you used to have Linux installed!
Have a lot of fun!
Note
I performed the installation on 2HD's and it works like a
charm.
I use the following menu list part for windows:
----------
title Windows XP
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
chainloader+1
makeactive
---------------
Difference:
I use 2x map otherwise you end up having 2x Windows
system.
|