Success story: Dual boot using two hard drives on a Asus P4P800-E Deluxe (Ubuntu/XP)
SUCCESS (How To): Dual boot using two hard drives on a Asus P4P800-E Deluxe (using Ubuntu 5.04 and Windows XP)
PROBLEM: There is a lot of ambiguous information on the internet about dual booting with this setup. The challenge stems from the nature of the GRUB bootloader and the way the BIOS on the P4P800-E Deluxe defines boot order. When booting "normally" into Windows XP, the first IDE drive (in my case, a SATA drive on the Promise 378 controller) is defined (in GRUB terms) as (hd0), with the Windows partition defined (in my case) as (hd0,1) and if you have another hard drive (in my case a PATA IDE drive), it is (hd1). However, if you boot from a linux distro installed on the 2nd hard drive, and you change the BIOS boot order to do so, then the device mappings according to GRUB. In this case, the linux drive (the PATA drive) is now (hd0) and the Windows partition is now (hd1,1). Setting up GRUB in the PATA drive will use these device mappings, so using a common dual-boot technique where one modifies the boot.ini file of Windows to point to a DOS copy of the GRUB bootloader, will not work. This fails because the file uses GRUB mappings in which (hd0) is the PATA drive, but you are booting from the first hard drive to load Windows, and therefore calling on boot.ini to load that file. The BIOS uses different mappings depending on which boot drive was considered "primary" and this can make the GRUB boot loader look for things on the wrong drives. This is a very confusing issue, and perhaps you can see why there is much ambiguity on the web about it. Here is a breakdown:
BIOS settings: Primary drive = Promise SATA, Secondary drive = PATA IDE HD
GRUB mappings: (hd0) = Promise SATA, (hd1) = PATA IDE HD
BIOS settings: Primary drive = PATA IDE HD. Secondary drive = Promise SATA
GRUB mappings: (hd0) = PATA IDE HD, (hd1) = Promise SATA
To rephrase the problem, suppose you boot in SCENARIO #2, to a linux install on the PATA HD, and use the technique described here: http://www.redlog.com/dualboot.html , which uses "dd if=/dev/hda of=/mnt/floppy/boot.lnx bs=512 count=1" to produce a DOS copy of the GRUB bootloader installed on the PATA HD. In this case, the DOS copy of GRUB is using the GRUB mappings defined in SCENARIO #2. Therefore, booting in SCENARIO #1, and attempting to run the DOS copy of GRUB (boot.lnx) will work, but booting from GRUB into linux will fail because GRUB is looking for linux on the wrong drive. This returns "Error 17" or "Error 18", I've seen both.
You must change the "device map" and "menu.lst" in GRUB to what would be the correct mappings when booting from the Windows hard drive. You must do this before creating the DOS file. Here is a step by step process of setting up this dual boot system.
Firstly, let's say Windows XP is on IDE0 and we want to put linux on IDE1. I'll use Ubuntu 5.04 for this example.
1)Boot from the Ubuntu install CD with your default BIOS boot order (probably something like Primary = Floppy, Secondary = CD-ROM, Third = Windows IDE0, Fourth = Linux IDE1).
2)Install Ubuntu with the desired options to IDE1. Allow GRUB to be installed to the MBR of that drive.
3)Reboot the computer, and press F8 at the "ASUS" screen to get a boot order menu. Choose the linux drive.
4)This should boot into Ubuntu using GRUB, which has automagically recognized your Windows XP partition on the other drive. Trying to select Windows XP from this menu will probably fail, because it is mapped to the wrong device.
5)Make a backup of /boot/grub/device.map like this:
sudo cp /boot/grub/device.map /boot/grub/device.map.backup
Make a backup of your linux MBR like this:
dd if=/dev/hd* of=/root/linux.mbr bs=512 count=1
(where * is the linux drive)
Make a backup of your WinXP MBR like this:
dd if=/dev/hd* of=/root/winxp.mbr bs=512 count=1
(where * is the winxp drive)
[NOTE: boot from a live CD and switch "if" and "of" to restore these backups]
6)Use your favorite text editor (as root) to change the /boot/grub/device.map file (as shown below if your first drive is a SATA IDE drive.) If your boot drive is a PATA IDE drive, use "hdb" instead of "sda". Either way, you will probably just be swapping (hd1) and (hd0) from the original version of this file.
[EDIT]Make sure /boot/grub/menu.lst has the correct drive mappings as well! You will probably need to modify all of the entries in the list of operating systems. For example, you will change many of the entries from (hd1,0) to (hd0,0). It may help to write down on a piece of paper what your BIOS will be calling the drives when you boot with the WinXP drive as 1st in the boot order, then write down what GRUB should call the drives based on your new device.map, and change your menu.lst to tell GRUB to look for each operating system in the correct places.[/EDIT]
7) Now, in the terminal, use the following command to start the GRUB console with your new device mapping:
8) In the GRUB console, make sure your new drives are set up correctly. Type:
The output will tell you what GRUB is calling your linux drive(s).
9) In the GRUB console, type:
where X,Y = the linux hard drive
10) Then type:
where X,Y = the linux hard drive.
11) Type "quit" to get back to terminal.
12) Now you've "broken" the GRUB on the MBR of your linux drive, because when you boot to that drive, your BIOS is calling it one thing, and GRUB is calling it another (thanks to the device.map file you edited). Let's make a DOS file that contains this new GRUB bootloader, which windows will run. Insert a floppy disk, and mount it. Type:
dd if=/dev/hd* of=/YOURFLOPPYDISK/boot.lnx bs=512 count=1
Where * = your linux drive
To "unbreak" the boot loader, restore your backup to the MBR as below:
dd if=/root/linux.mbr of=/dev/hd* bs=512 count=1
Where * = your linux drive.
13) Boot into windows and copy boot.lnx from the floppy to C:\ Then, follow the instructions at http://www.redlog.com/dualboot.html to edit your boot.ini to give you an option where it will load "C:\boot.lnx" .
14) Change your normal BIOS settings so it always boots to the Windows drive. Simply select the new Linux entry from the Windows XP boot loader screen to run GRUB, then choose your preferred Linux image!
I hope this helps someone. Please post successes/failures below. Good luck.
Fisslefink at yahoo dot com
I almost started this w/ "WTF is a PATA?", but then I googled & found that you must mean parallel ATA (not portable). In as much as this a a new terminolgy & not yet standard -- many of us think that "ATA" means parallel, how about including an explanation of "PATA" until the rest of us catch up.
You have done well to illustrate that GRUB-speak does not not match Linux or BIOS talk or the physical cabling. AFAIK GNU/Linux drive designations are a 1-to-1 match w/ the physical cabling, whereas GRUB (at least roughly) follows the BIOS designations.
I have a question -- why subject yourself the hassle of messing w/ M$ boot.ini, whose syntax is even murkier than GRUB's, when you could easily chainload Win from GRUB? My experience is that most distros successfully add a Win stanza to menu.lst during installation. By leaving the Win drive untouched, you facilitate the return (think company computer) to the box's original Win only condition.
Thanks for this one guys, it solved a problem I have been wrestling with for months.
Using the same motherboard and its ICH5R SATA Raid setup, this technique worked perfectly.
One tiny clarification - in paragraph 12) it was necessary when making the "boot.lnx" file to use "dd if/dev/hdb ...", not /dev/hdb1. This caught me out the first time ( x 10).
Now if only I could get FC4 to read the Sata Raid NTFS partitions. ...
Whoeee ... where to start.
This thread is based on several misunderstandings/errors, and as such makes things *wayyyy* too complicated.
You DO NOT (repeat DO NOT) need, or want IMHO, to change the BIOS boot order to dual-boot Windows and Linux - this is one of the major reasons why boot-loaders exist.
Now go back and read that that redlog.com link - there is NO mention of swapping the BIOS boot order.
*All* the problems encountered are due to swapping the order and not understanding the consequences.
So long as you have XP installed (on the first hard disk) - regardless of whether it is the PATA or the SATA - and install Linux to the second disk (without changing the BIOS boot order) as per the redlog.com link (i.e. to a partition, not to the MBR), things are easy.
Of course the better solution is to install a Linux boot loader into the MBR of the first disk, but some (usually new Linux) users aren't comfortable with that.
|All times are GMT -5. The time now is 01:30 AM.|