Boot Loader: how to access windows on another disk

Hello,

Having had numerous problems trying to install a dual boot SuSE 11.0 / Windows 2000 system, I decided to install SuSE on one of the disks and then disconnected it and installed Windows on the other disk as stand-alone.

Both systems boot without a hitch when their respective disk is selected in BIOS as the first boot device.

I now went into YaST and tried to add an entry in the boot loader. Having seen such entries before I chose it to be a chainloader, gave it the correct device address (/dev/sdb1) and ticked both “activate this partition when selected for boot” and “do not verify filesystem”.

Unfortunately, when I restart the machine and select the windows option I get the message that the disk is not bootable.

How do I make GRUB recognise the disk as bootable?

Thanks,

Abe

Additional information:

I have just looked at the boot.ini file on the win2000 partition (first partition of the second disk in my system). It contains:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT=“Microsoft Windows 2000 Professional”
/fastdetect

I also noticed that when I edit the bootloader entry of win2000 under YaST, although I change the “other system” entry to /dev/sdb1 (I have to do this manually - the drop down only gives me /dev/sda1), it switches back to /dev/sda1 when I look at it seconds later. It is as if SuSE’s bootloader does not recognize the /dev/sdb1 partition, although it is present and mounted.

Please help,

Abe

I don’t know English well. But as I understand you have disconnect you hard drive with Suse during the Windows installing. Why you had do it? You need save your MBR in Linux before Windows installing and restore it after Windows installing. It is one variant.

Please post your /boot/grub/menu.lst text file so we can see what you’ve got set up. Your /etc/fstab will help too. I think you may need to use the root switching trick to make Windows boot. I may be able to help once you post more info.

I think the advice given for the Vista Multiboot may help, you boot Win 9x same way, so I shouldn’t think NT/2000 would mind same treatment.

Vista is installed on it’s own disk in 3rd partition, I make it think it’s on first BIOS disk 0x80 with the map commands.

title Vista
rootnoverify (hd1,2)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader (hd1,2)+1

Linux boot is on first disk hd0, and I believe I have GRUB installed into the MBR, though it might be in the /dev/sda1 partition as that is active.

title Win2000
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader (hd1,0)+1

Is what I’d tell you to have in your /boot/grub/menu.list file for the Windows entry, then use GRUB boot menu, to select Windows.

It’s good precautionary practice to do that, also you know exactly where you are. Windows is desperate to install into C: and be on first disk, why take any uncessary risks with your Linux installation?

As I explained in a later post, I have two SATA disks, one with a working SuSE 11.0 and one with a working, bootable Windows 2000. There is also an old PATA disk in the system. I am trying to point grub on the SuSE 11.0 disk to load win2000 off of the second disk. I am not sure the advice pertaining to Vista is exactly the same for win2000 but I followed the advice given in the excellent document of swerdna (the second sticky post in this forum), and added a mapping of hd0 to hd1 and vice versa. Unfortunately this did not help. What I get when I try to boot into win2000 is:


rootnoverify(hd1,0)
chainloader(hd1,0)+1

Error 25: disk read error

Following the previous request here is my /boot/grub/menu.lst :


# Modified by YaST2. Last modification on Tue Dec 23 23:44:20 GMT 2008
default 0
timeout 8
gfxmenu (hd0,4)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.0 (default)
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.25.18-0.2-default root=/dev/disk/by-id/scsi-SATA_ST
3500320AS_9QM83JL6-part5 resume=/dev/sda6 splash=silent showopts vga=0x31a
    initrd /boot/initrd-2.6.25.18-0.2-default

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.0 (default)
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.25.18-0.2-default root=/dev/disk/by-id/scsi-SATA_ST
3500320AS_9QM83JL6-part5 showopts ide=nodma apm=off acpi=off noresume nosmp noap
ic maxcpus=0 edd=off x11failsafe vga=0x31a
    initrd /boot/initrd-2.6.25.18-0.2-default

title win2000
    map(hd0)(hd1)
    map(hd1)(hd0)
    rootnoverify (hd1,0)
    chainloader (hd1,0)+1

###Don't change this comment - YaST2 identifier: Original name: floppy###
title Floppy
    rootnoverify (hd0,4)
    chainloader (fd0)+1

Here is my /etc/fstab :


/dev/disk/by-id/scsi-SATA_ST3500320AS_9QM83JL6-part6 swap                 swap
     defaults              0 0
/dev/disk/by-id/scsi-SATA_ST3500320AS_9QM83JL6-part5 /                    ext3
     acl,user_xattr        1 1
/dev/disk/by-id/scsi-SATA_ST3500320AS_9QM83JL6-part7 /home                ext3
     acl,user_xattr        1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
/dev/disk/by-id/ata-ST380215A_9QZ354CM-part1 /win/c               vfat       use
rs,gid=users,umask=0002,utf8=true 0 0

/dev/disk/by-id/ata-ST380215A_9QZ354CM-part6 /home_old            ext3       def
aults              1 2
/dev/disk/by-id/ata-ST380215A_9QZ354CM-part5 /lin_old             ext3       def
aults              1 2
/dev/disk/by-id/ata-ST380215A_9QZ354CM-part3 /win/d               vfat       use
rs,gid=users,umask=0002,utf8=true 0 0
/dev/disk/by-id/scsi-SATA_ST380815AS_6RW30J7T-part1 /winnt               ntfs-3g
    users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
/dev/disk/by-id/scsi-SATA_ST3500320AS_9QM83JL6-part1 /backup              ext3
     acl,user_xattr        1 2

I would be grateful for any advice you can give.

Abe

I don’t know if that matters, but I suggested :

title Win2000
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader (hd1,0)+1

And you have ‘rootnoverify’ after the map commands. Also there’s no space after map and the (. You have map(hd0)

Are you sure the 2 PATA disks are BIOS disks 0x80 and 0x81? 1st and 2nd to scan. It’s possible the PATA IDE disk is one given 0x81 and so the (hd1) in GRUB menu file?

Also check with “fdisk -l /dev/sdb” that your Win2002 really is in the first partition of the 2nd disk.

There might be non active partitions, left there by the manufacturer for their own purposes (Dell put the main OS in 3rd partition for example).

Mine looks like this :

fir:~ # fdisk -l /dev/sdb

Disk /dev/sdb: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe56c33ff

Device Boot Start End Blocks Id System
/dev/sdb1 1 7 56196 de Dell Utility
/dev/sdb2 8 1313 10485760 7 HPFS/NTFS
/dev/sdb3 * 1313 8232 55575530 7 HPFS/NTFS
/dev/sdb4 17398 30394 104398402+ 5 Extended
/dev/sdb5 17398 18162 6144831 82 Linux swap / Solaris
/dev/sdb6 18163 21986 30716248+ b W95 FAT32

Try removing the power from the PATA disk, if you find no mistake and the problem persists.

You are absolutely right. I changed it as you suggested but that in itself did not solve the problem. However, your next point:

Try removing the power from the PATA disk, if you find no mistake and the problem persists.

was spot on. The PATA disk (there is only one) was occupying the “hda1” slot and as it is not bootable I could not get into the windows system. Once I disconnected its IDE cable the second SATA drive was recognized as hda1 and I could boot into windows.

Many thanks for the advice and for everybody else’s help. One happy customer here lol!

Abe

Hey mate,

It seems like you trying to get to heaven by going through hell… here’s what you gotta do: [may seem quite complex, but very simple once you get it]

NOTE: I AM ONLY REFERING TO INSTALLING OPENSUSE AND WINDOWS ON ONE PHYSICAL HARDWARE, AND 2 DIFFERENT PARTITIONS

  1. Windows is installed on sda1 (or C drive)
  2. Grab a copy of PartedMagic (its around 40mb, and is an ISO, and then burn it to a CD)
  3. Install openSuse on sda2(ext3) and sda3(swap), with the following grub installation parameters:

-Tell grub to install itself to the ROOT partition, not extended, and certainly not MBR or BOOT…

-you can do this, just in the confirmation page of the suse installation

  1. Once installation done, then reboot… You should be able to go to Windows but not Suse, but that is no problem…
  2. In windows, click on Run -> type: ‘c:\boot.ini’ -> You should see something like this:

[boot loader]
timeout=10
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS=“Microsoft Windows XP Professional” /noexecute=optin /fastdetect /bootlog

add the following like to the end of the file:

C:\grub.mbr=“openSuse 11.1”

5)Save and then put the PartedMagic in and then restart and boot from the Cd…

6)Load the program with all the default selections (wouldn’t really need to change anything)

7)From the utilities on the bottom, select mount helper (or something like that), then mount the XP drive on…

8)Open the cosole, and type the following down:

dd if=/dev/sda2 of=grub.mbr bs=512 count=1

the press enter, the type the following

cp grub.mbr /sda1/grub.mbr

9)restart the computer, boot to Windows (just to make sure that your windows is not screwed) then reboot and boot to suse…

10)AND YOU ARE DONE!!!

Hi,

Thanks for this advice - I hope it helps others with a similar predicament.

I follow the old engineering maxim “if it ain’t broke, don’t fix it”, which is why I decided not to do what you suggest. I have a working dual-boot system and I think that the solution, once I got to it with the help of the good members of this forum, is quite simple and elegant.

Thanks again!

I did just a quick scan of this thread . . . for future reference . . .

When installing to a disk with the other disk disconnected, the disk order will be changed compared to if it were disconnected. That is, if install Linux on 2nd disk with 1st disabled, then sdb will be seen as sda. Grub’s device.map will have sda as (hd0), which will in fact be the 2nd disk. Now, once grub is installed (device.map is only consulted by the grub shell when it is installing its stage1), and if the bios is set to boot the 2nd drive, that will work fine (because the installed grub references geometries only on its own disk). But things can get confused when chainloading. So when installing the boot loader, it’s important to understand device.map, how grub finds the disks, how this is affected by the bios boot setting, and how that can change when drives are disconnected or reconnected - these are inter-related.

There is only one important lesson I learnt that I would like to add to this: the above process of mapping hd0/hd1 will work well if you have two scsi disks, each installed with one OS in stand-alone mode. Things get more confused if there is also an IDE disk in the system, because it somehow gets mapped to hda1 ahead of the second scsi disk, and will cause the bootloader to go to the wrong place when trying to boot off the second disk. So the advice is: if you have two scsi disks disconnect all ide drives to let the bootloader to work well.

This happens sometimes, sometimes not. The fundamental problem is that, one one hand, bios’s are not consistent in how they write the hardware map. Second, grub can only make an educated guess (it uses an algorithm) as to the boot device order, as this data is not passed by the bios. When the grub shell is run from inside the OS, it has the kernel to help with the mapping along with the device.map file. When grub is run outside the OS, it does not; it reads the bios map instead. This is a little known detail about grub, i.e., that run standalone from its shell (for example, on a boot floppy without device.map) it may see the disks differently than when run from inside the OS.