1

I've added a second Disk to my system and copied my linux-installation + grub on it. My system contains 2 disks now:

hd0: 
sda5: linux

hd1: (old system with dualboot)
sdb2: windows
sdb5: linux

If I boot from hd1 (Bios boot menu or unplug hd0), windows starts immediatly, but if I boot from hd0 and select to boot from windows, it only shows me a black screen with a blinking courser.

hd0/grub.cfg (doesn't work)

menuentry 'Windows 7 (loader) (/dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-9C567F24567EFE78' {
        insmod part_msdos
        insmod ntfs
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  9C567F24567EFE78
        else
          search --no-floppy --fs-uuid --set=root 9C567F24567EFE78
        fi
        parttool ${root} hidden-
        chainloader +1
}

hd1/grub.cfg (works)

menuentry 'Windows 7 (loader) (/dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-9C567F24567EFE78' {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9C567F24567EFE78
    else
      search --no-floppy --fs-uuid --set=root 9C567F24567EFE78
    fi
    parttool ${root} hidden-
    chainloader +1
}

PS: My system is kinda old now (athlon x4) with a normal bios and not UEFI.

Any ideas, or how can I get more debug information?

Or is there some limitation and windows always needs to be installed on first harddrive? (Even in 2016)

Solution:

menuentry 'Windows 7 cust' --class windows --class os $menuentry_id_option 'osprober-chain-9C567F24567EFE78' {
        insmod part_msdos
        insmod ntfs
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  9C567F24567EFE78
        else
          search --no-floppy --fs-uuid --set=root 9C567F24567EFE78
        fi
###parttool ${root} hidden-
        drivemap -s (hd0) ${root} ### intern disk swap
        chainloader +1
}
  • Or is there some limitation and windows always needs to be installed on first harddrive? (Even in 2016) - Yep. – axvm Jan 12 '16 at 9:04
1

Booting windows with grub on a non-first drive is a bit tricky: you will have to swap your disks:

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 drivemap (see drivemap), like this:
drivemap -s (hd0) (hd1)

More details at https://www.gnu.org/software/grub/manual/html_node/DOS_002fWindows.html#DOS_002fWindows

  • Thanks, it worked. I tried with the old map command which isn't supported by grub anymore. – Martin Baumgartner Jan 12 '16 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.