LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 01-25-2007, 08:54 PM   #1
rewtedesco
Member
 
Registered: Oct 2005
Location: Massachusetts
Distribution: Suse 10.0 /XP/ FC5 & 6
Posts: 93

Rep: Reputation: 16
A fixed dual boot double disk problem - why did it go wrong in the first place?


I ran into an already reported problem with a Fedora 6/ XP - dual boot installation, where two disks are used. I fixed it but would like to understand what the installer did wrong in the first place.
The system is a HPa1250n with preinstalled XP on the first disk (240GB). I installed a second disk (160GB) a year ago and put Suse on it. There wasn't a problem with dual boot, but I don't remember what I did right then. On the second disk I had a partition formated with FAT32 to use from either Linux or Windows and the rest a reiser partion for linux.
For the new installation over the old Suse, I didn't make changes to the disk partitions, and so I have (copied and simplified, from the view in gparted - Gnome partition editor):

240 GB disk:
/dev/sda1: fat32 8 GB
/dev/sda2: ntfs 225 GB
160 GB disk:
/dev/sdb1: fat32 32 GB
/dev/sdb2: ext3 95 MB /boot
/dev/sdb3: unknown 117 GB (LVM for Fedora 6)

During installation, the Fedora installer by default proposed to write the boot sector of the first disk, to /dev/sda. I let it do this.
Afterwards I couldn't boot anything ("grub error 17" were the last words).
I tried then the method of switching the disk order and put the boot sector in /dev/sdb1, which was the other possibility provided by the installer. The reversed order of the devices can be seen in the file /boot/grub/device.map:
Code:
# this device map was generated by anaconda
(hd1)     /dev/sda
(hd0)     /dev/sdb
Furthermore, in the bios settings, the disk order is now interchanged. Bios looks first at the boot sector of the /dev/sdb disk. After the installation, I could boot Fedora 6 but XP would just hang. I read around here and in various places and found the work around to be an editing of the grub.conf file in /boot/grub/grub.conf (see red lines):
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,1)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sdb2
default=0
timeout=5
splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.19-1.2895.fc6)
        root (hd0,1)
        kernel /vmlinuz-2.6.19-1.2895.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.19-1.2895.fc6.img
title Fedora Core (2.6.18-1.2798.fc6)
        root (hd0,1)
        kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-1.2798.fc6.img
title WinXP
        rootnoverify (hd1,1)
        map (hd0) (hd1)
        map (hd1) (hd0)
        makeactive
        chainloader +1
Note that the red lines were inserted later by hand to make it actually work. Without those lines XP wouldn't boot.

Ok it works all right, but I still wonder: In the first attempt I had obviously overwritten the MBR of the big disk /dev/sda. I did't restore it or anything. I don't have an XP rescue disk, it's not provided with the PC, so I could not restore the MBR. Which is why I made it the secondary disk.
However, the documentation of grub makes the following point about this remapping business: (from http://www.gnu.org/software/grub/man..._002fWindows):
If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one. The workaround used in GRUB is the command map (see map), like this:

grub> map (hd0) (hd1)
grub> map (hd1) (hd0)

This performs a virtual swap between your first and second hard drive.

Caution: This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won't work.


Considering the above comment, I would have prefered to leave the disk order as it was - which is the default method in the Fedora installer - even though the disk switching scheme works for me right now.

So my question is: What exactly does the Fedora installer wrong if the default method is used?
 
Old 01-26-2007, 08:56 PM   #2
tbutttbutt
Member
 
Registered: Jan 2006
Location: India
Distribution: Fedora 7, Linuxfromscratch 6.2
Posts: 66

Rep: Reputation: 15
According to grub info .. troubleshooting, error 17 is

17 : Cannot mount selected partition
This error is returned if the partition requested exists, but the
filesystem type cannot be recognized by GRUB.

I have had similar problems. I think I let grub write to the second hard disk (hdb)where I had installed Fedora 5, when I should have installed grub to the first hard disk (hda). You seem to have installed it correctly i.e. to sda, the first time, and both Windows and Linux should have been able to boot correctly.

The error message is the only hint you have to what could have gone wrong. I too have had to use a workaround -- which is a grub floppy!
 
Old 01-27-2007, 10:55 PM   #3
rewtedesco
Member
 
Registered: Oct 2005
Location: Massachusetts
Distribution: Suse 10.0 /XP/ FC5 & 6
Posts: 93

Original Poster
Rep: Reputation: 16
You're probably right - I suppose i needed somehow to indicate which file system type it is in the grub.conf. I'm not sure how to do this (and whether I want to try this, as everything's working for now) I'll keep this in mind the next time around.
I wonder also if the whole problem had to do with the fact that there are indeed two sectors of windows on the first hard disk, an 8 GB block for "rescue" (which is why they don't bother sending a rescue DVD or CD with the purchased PC) followed by the main windows XP partition. The following can be found also in the documentation of grub. http://www.gnu.org/software/grub/man...n_002dloading:
Quote:

Another problem arises if you installed more than one set of DOS/Windows onto one disk, because they could be confused if there are more than one primary partitions for DOS/Windows. Certainly you should avoid doing this, but there is a solution if you do want to do so. Use the partition hiding/unhiding technique.

If GRUB hides a DOS (or Windows) partition (see hide), DOS (or Windows) will ignore the partition. If GRUB unhides a DOS (or Windows) partition (see unhide), DOS (or Windows) will detect the partition. Thus, if you have installed DOS (or Windows) on the first and the second partition of the first hard disk, and you want to boot the copy on the first partition, do the following:
grub> unhide (hd0,0)
grub> hide (hd0,1)
grub> rootnoverify (hd0,0)
grub> chainloader +1
grub> makeactive
grub> boot
Since I want to boot the second sector, I suppose I would then have to write instead in the grub.conf file:
Code:
unhide (hd0,1)
hide   (hd0,0)
rootnoverify (hd0,1)
chainloader +1
makeactive
boot
I haven't tried this, but if this is the solution (if a wizz here gives the blessings) I might try it out. But then there's also the principle "Don't wake up sleeping dogs".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Has the dual boot problem been fixed? (chainloader) Nodscene Linux - Distributions 4 03-13-2005 06:30 PM
Fedora / XP dual boot woes (not fixed by sfdisk) HenryR Fedora - Installation 0 12-05-2004 08:22 AM
Fedora 3- is the dual-boot bug fixed? artemis Fedora 4 11-26-2004 01:10 PM
FC2 disk geometry (NOT double boot) ferrix Fedora 1 05-28-2004 02:22 AM
dual boot problem with hard disk =( aktee67 Mandriva 5 02-05-2004 08:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 09:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration