Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to run grub2 on 2 hard drives?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Fri Apr 04, 2014 12:17 pm    Post subject: How to run grub2 on 2 hard drives? Reply with quote

Hi,

I have 2 HDs in the computer - On sdb there is win7 and I installed gentoo on sda.
When I run grub2 - as described in the handbook - it find out only gentoo but not win7.
It seems that grub run only on sda - how can I run grub2 so that will find out win7 as well - which installed in the other HD?
Back to top
View user's profile Send private message
Gankfest
l33t
l33t


Joined: 01 Aug 2007
Posts: 946
Location: Miami Beach, FL

PostPosted: Fri Apr 04, 2014 2:22 pm    Post subject: Reply with quote

post grub.conf please.

It should look something like this for your windows edit.

Code:
title Windows 7
rootnoverify (hd0,n)
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1


post output of:

Code:
fdisk - l

_________________
Gankfest™ (>")> ~*

Everyone has to start somewhere, it depends on where you end up that counts! (>")>
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Fri Apr 04, 2014 3:10 pm    Post subject: Reply with quote

Gankfest Hi,

Here fdisk -l output and for grub.conf - please explain where it should be - or do you mean grub.cfg? - I am new in town... :lol:
Thanks

Code:
Disk /dev/sda: 164.7 GB, 164696555520 bytes, 321672960 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe41fdb4a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048        6143        2048   ef  EFI (FAT-12/16/32)
/dev/sda2   *        6144      268287      131072   83  Linux
/dev/sda3          268288     4462591     2097152   82  Linux swap / Solaris
/dev/sda4         4462592   321672959   158605184   83  Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x63aa0b54

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   976771071   488384512    7  HPFS/NTFS/exFAT
Back to top
View user's profile Send private message
Gankfest
l33t
l33t


Joined: 01 Aug 2007
Posts: 946
Location: Miami Beach, FL

PostPosted: Fri Apr 04, 2014 3:38 pm    Post subject: Reply with quote

Ya grub.cfg for grub 2
_________________
Gankfest™ (>")> ~*

Everyone has to start somewhere, it depends on where you end up that counts! (>")>
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Fri Apr 04, 2014 5:51 pm    Post subject: Reply with quote

ok, here grub.cfg:
[code]#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}

if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4 fc0e8cbd-a295-4822-9e21-ba434d0b991e
else
search --no-floppy --fs-uuid --set=root fc0e8cbd-a295-4822-9e21-ba434d0b991e
fi
font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=
insmod gettext
fi
terminal_output gfxterm
if sleep --interruptible 0 ; then
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-fc0e8cbd-a295-4822-9e21-ba434d0b991e' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 411bbb56-dc32-4290-80b2-c368643a52ec
else
search --no-floppy --fs-uuid --set=root 411bbb56-dc32-4290-80b2-c368643a52ec
fi
echo 'Loading Linux 3.12.13-gentoo ...'
linux /kernel-3.12.13-gentoo root=/dev/sda4 ro
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-fc0e8cbd-a295-4822-9e21-ba434d0b991e' {
menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-advanced-fc0e8cbd-a295-4822-9e21-ba434d0b991e' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 411bbb56-dc32-4290-80b2-c368643a52ec
else
search --no-floppy --fs-uuid --set=root 411bbb56-dc32-4290-80b2-c368643a52ec
fi
echo 'Loading Linux 3.12.13-gentoo ...'
linux /kernel-3.12.13-gentoo root=/dev/sda4 ro
}
menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-recovery-fc0e8cbd-a295-4822-9e21-ba434d0b991e' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 411bbb56-dc32-4290-80b2-c368643a52ec
else
search --no-floppy --fs-uuid --set=root 411bbb56-dc32-4290-80b2-c368643a52ec
fi
echo 'Loading Linux 3.12.13-gentoo ...'
linux /kernel-3.12.13-gentoo root=/dev/sda4 ro single
}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Thanks
Back to top
View user's profile Send private message
Gankfest
l33t
l33t


Joined: 01 Aug 2007
Posts: 946
Location: Miami Beach, FL

PostPosted: Fri Apr 04, 2014 6:13 pm    Post subject: Reply with quote

Post what's in this file:

Code:
/etc/grub.d/40_custom


We might have to manually add windows to the list...
_________________
Gankfest™ (>")> ~*

Everyone has to start somewhere, it depends on where you end up that counts! (>")>
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Fri Apr 04, 2014 6:23 pm    Post subject: Reply with quote

Here /etc/grub.d/40_custom

Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


I wonder why grub does not find win7 - it suppose to check all HDs of the computer, including sdb...
Back to top
View user's profile Send private message
Gankfest
l33t
l33t


Joined: 01 Aug 2007
Posts: 946
Location: Miami Beach, FL

PostPosted: Fri Apr 04, 2014 6:40 pm    Post subject: Reply with quote

pmam wrote:
Here /etc/grub.d/40_custom

Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


I wonder why grub does not find win7 - it suppose to check all HDs of the computer, including sdb...


Why I use grub, and just use links to copy over the kernel every time I re-compile it. I'm a firm believer in why fix what isn't broken in the first place!

Anyway, try adding this to the 40_custom.

Code:
menuentry "Windows 7 (on sdb)" {
        set root=(hd1,0)
        chainloader +1
}


If that doesn't work, than idk... I use Grub and I'm no expert with Grub 2! :D
_________________
Gankfest™ (>")> ~*

Everyone has to start somewhere, it depends on where you end up that counts! (>")>
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Fri Apr 04, 2014 6:56 pm    Post subject: Reply with quote

Quote:
If that doesn't work, than idk... I use Grub and I'm no expert with Grub 2! :D

It does not work.. :cry:
I will wait to grub2's expert, if there is anyone out there...

Thanks
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Fri Apr 04, 2014 6:58 pm    Post subject: Reply with quote

Quote:
If that doesn't work, than idk... I use Grub and I'm no expert with Grub 2! :D

It does not work.. :cry:
I will wait to grub2's expert, if there is anyone out there...

Thanks
Back to top
View user's profile Send private message
gotyaoi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Apr 2013
Posts: 137

PostPosted: Fri Apr 04, 2014 8:40 pm    Post subject: Reply with quote

Perhaps these bits of the wiki are applicable to your situation?

https://wiki.gentoo.org/wiki/GRUB2_Quick_Start#Loading_another_operating_system
http://wiki.gentoo.org/wiki/GRUB2#Probing
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum